headers

package
v1.82.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: BSD-3-Clause Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package headers provides the C system headers of modernc.org/libc for the target it is built for, for C compilers that run without host files.

The headers are musl's public include tree, configured for the target, as libc's generator writes it to include/<goos>/<goarch> in this module. These are the files ccgo/v4 uses by default when it translates C against libc. They describe libc's ABI as ccgo sees it, so a compiler must use them the way ccgo does. It must predefine __CCGO__, which makes long double a double, as libc implements it, and the predefined macros of the target. ccgo also defines _GNU_SOURCE.

Each target's headers are embedded as a ZIP archive, so a binary carries only its own target's headers, and only if it calls FS. Importing the package costs nothing otherwise. Only linux/amd64 has headers so far; on other targets FS fails.

musl is distributed under the MIT license. Its copyright notice is the file COPYRIGHT in the root of the tree FS returns.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FS

func FS() (fs.FS, error)

FS returns the include tree of the target: FS().Open("stdio.h") opens what #include <stdio.h> includes. Each call returns a new *zip.Reader, which may be used concurrently.

No package-level initializer may refer to archive, otherwise the linker would keep it in every binary importing the package.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL