newsgnulib - GNU portability library - News


Gnulib can help your C++ programs

Item posted by Bruno Haible <haible> on Wed 16 Dec 2020 08:31:05 PM UTC.

Typically you test your programs on glibc systems.  Gnulib helps you to have the same program compile and work fine on other platforms, such as musl libc systems, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Solaris, Cygwin, mingw, MSVC, Haiku, and even Minix and Android.

To do so, Gnulib implements many functions specified by POSIX or found in glibc if the platforms lacks them, and adds workarounds for bugs in the platform implementations.  These substitutes are now (since 2019, actually) available also to C++ programs, if your program accesses these functions directly.

This does, however, not mean that if the libstdc++ or some boost library use the libc functions, they will benefit from the same workarounds; this is outside the scope of what Gnulib can provide.

Also, portability problems in the libstdc++ library itself are outside of the scope of Gnulib as well.

Despite these limitations: enjoy!

Back to the top

Powered by Savane 3.13-4b48.
Corresponding source code