The GNU C Library: Adding Platform-specific

Up: Source Layout   [Contents][Index]


D.1.1 Platform-specific types, macros and functions

It’s sometimes necessary to provide nonstandard, platform-specific features to developers. The C library is traditionally the lowest library layer, so it makes sense for it to provide these low-level features. However, including these features in the C library may be a disadvantage if another package provides them as well as there will be two conflicting versions of them. Also, the features won’t be available to projects that do not use the GNU C Library but use other GNU tools, like GCC.

The current guidelines are:

The general solution for providing low-level features is to export them as follows:

The easiest way to provide a header file is to add it to the sysdep_headers variable. For example, the combination of Linux-specific header files on PowerPC could be provided like this:

sysdep_headers += sys/platform/ppc.h

Then ensure that you have added a sys/platform/ppc.h header file in the machine-specific directory, e.g., sysdeps/powerpc/sys/platform/ppc.h.


Up: Source Layout   [Contents][Index]