doc/gnulib.texi (Header files): Add note about C++ problems.
[gnulib.git] / doc / gnulib.texi
index ddccc5c..e98f124 100644 (file)
@@ -10,7 +10,8 @@
 @end ifclear
 @comment %**end of header
 
-@set UPDATED $Date: 2007-09-09 13:20:45 $
+@comment Defines the UPDATED variable.
+@include updated-stamp
 
 @copying
 This manual is for GNU Gnulib (updated @value{UPDATED}),
@@ -65,6 +66,18 @@ Texts.  A copy of the license is included in the section entitled
 * Index::
 @end menu
 
+@c This is used at the beginning of four chapters.
+@macro nosuchmodulenote{thing}
+The notation ``Gnulib module: ---'' means that Gnulib does not provide a
+module providing a substitute for the \thing\.  When the list
+``Portability problems not fixed by Gnulib'' is empty, such a module is
+not needed: No portability problems are known.  Otherwise, it indicates
+that such a module would be useful but is not available: No one so far
+found this \thing\ important enough to contribute a substitute for it.
+If you need this particular \thing\, you may write to
+@w{@code{<bug-gnulib at gnu dot org>}}.
+@end macro
+
 @node Introduction
 @chapter Introduction
 
@@ -186,6 +199,11 @@ preference might depend on whether you consider the API exported by
 your header file as something available for C programs only, or for C
 and C++ programs alike.
 
+Note that putting a @code{#include} in an @code{extern "C" @{ ... @}}
+block yields a syntax error in C++ mode on some platforms.  For this
+reason, it is recommended to place the @code{#include} before the
+@code{extern "C"} block.
+
 @subheading Include ordering
 
 When writing a gnulib module, or even in general, a good way to order
@@ -313,21 +331,16 @@ other functions too.
 
 The getaddrinfo function exists in ws2tcpip.h and -lws2_32 on Windows
 XP.  The function declaration is present if @code{WINVER >= 0x0501}.
-Windows 2000 does not have getaddrinfo in its @file{WS2_32.dll}.
+Windows 2000 does not have getaddrinfo in its @file{WS2_32.DLL}.
 
 Thus, if you want to assume Windows XP or later, you can add
 AC_DEFINE(WINVER, 0x0501) to avoid compiling to (partial) getaddrinfo
 implementation.
 
-If you want to support Windows 2000, don't do anything, but be aware
-that gnulib will use its own (partial) getaddrinfo implementation even
-on Windows XP.  Currently the code does not attempt to determine if
-the getaddrinfo function is available during runtime.
-
-Todo: Make getaddrinfo.c open the WS2_32.DLL and check for the
-getaddrinfo symbol and use it if present, otherwise fall back to our
-own implementation.
-
+If you want to support Windows 2000, don't do anything.  The
+replacement function will open @file{WS2_32.DLL} during run-time to
+see if there is a getaddrinfo function available, and use it when
+available.
 
 @node Libtool and Windows
 @section Libtool and Windows
@@ -386,7 +399,7 @@ On a machine with recent automake, autoconf, m4 installed and with a
 gnulib git or cvs checkout (typically a Linux machine), use
 
 @example
-gnulib-tool --create-megatestdir --with-tests --dir=..."
+gnulib-tool --create-megatestdir --with-tests --dir=...
 @end example
 
 Note: The created directory uses ca. 512 MB on disk.
@@ -461,6 +474,8 @@ This chapter describes which header files specified by ISO C or POSIX are
 substituted by Gnulib, which portability pitfalls are fixed by Gnulib, and
 which (known) portability problems are not worked around by Gnulib.
 
+@nosuchmodulenote header file
+
 @menu
 * aio.h::
 * arpa/inet.h::
@@ -641,14 +656,7 @@ ISO C or POSIX are substituted by Gnulib, which portability pitfalls are
 fixed by Gnulib, and which (known) portability problems are not worked around
 by Gnulib.
 
-The notation ``Gnulib module: ---'' means that Gnulib does not provide a
-module providing a substitute for the function.  When the list
-``Portability problems not fixed by Gnulib'' is empty, such a module is
-not needed: No portability problems are known.  Otherwise, it indicates
-that such a module would be useful but is not available: No one so far
-found this function important enough to contribute a substitute for it.
-If you need this particular function, you may write to
-@code{<bug-gnulib at gnu dot org>}.
+@nosuchmodulenote function
 
 @menu
 * FD_CLR::
@@ -2898,6 +2906,8 @@ specified by ISO C or POSIX are substituted by Gnulib, which portability
 pitfalls are fixed by Gnulib, and which (known) portability problems are
 not worked around by Gnulib.
 
+@nosuchmodulenote header file
+
 @menu
 * a.out.h::
 * aliases.h::
@@ -2927,6 +2937,7 @@ not worked around by Gnulib.
 * pty.h::
 * resolv.h::
 * shadow.h::
+* sys/ioctl.h::
 * sysexits.h::
 * ttyent.h::
 @end menu
@@ -2959,6 +2970,7 @@ not worked around by Gnulib.
 @include glibc-headers/pty.texi
 @include glibc-headers/resolv.texi
 @include glibc-headers/shadow.texi
+@include glibc-headers/sys_ioctl.texi
 @include glibc-headers/sysexits.texi
 @include glibc-headers/ttyent.texi
 
@@ -2970,131 +2982,124 @@ provided as extensions by at least GNU libc are also supported by Gnulib,
 which portability pitfalls are fixed by Gnulib, and which (known)
 portability problems are not worked around by Gnulib.
 
-The notation ``Gnulib module: ---'' means that Gnulib does not provide a
-module providing a substitute for the function.  When the list
-``Portability problems not fixed by Gnulib'' is empty, such a module is
-not needed: No portability problems are known.  Otherwise, it indicates
-that such a module would be useful but is not available: No one so far
-found this function important enough to contribute a substitute for it.
-If you need this particular function, you may write to
-@code{<bug-gnulib at gnu dot org>}.
+@nosuchmodulenote function
 
 This list of functions is sorted according to the header that declares them.
 
 @menu
-* Glibc aio.h::                 
-* Glibc aliases.h::             
-* Glibc argp.h::                
-* Glibc argz.h::                
-* Glibc arpa/inet.h::           
-* Glibc byteswap.h::            
-* Glibc complex.h::             
-* Glibc crypt.h::               
-* Glibc ctype.h::               
-* Glibc dirent.h::              
-* Glibc dlfcn.h::               
-* Glibc envz.h::                
-* Glibc err.h::                 
-* Glibc errno.h::               
-* Glibc error.h::               
-* Glibc execinfo.h::            
-* Glibc fcntl.h::               
-* Glibc fenv.h::                
-* Glibc fmtmsg.h::              
-* Glibc fstab.h::               
-* Glibc fts.h::                 
-* Glibc getopt.h::              
-* Glibc glob.h::                
-* Glibc gnu/libc-version.h::    
-* Glibc grp.h::                 
-* Glibc ifaddrs.h::             
-* Glibc langinfo.h::            
-* Glibc libintl.h::             
-* Glibc link.h::                
-* Glibc locale.h::              
-* Glibc malloc.h::              
-* Glibc math.h::                
-* Glibc mcheck.h::              
-* Glibc monetary.h::            
-* Glibc mntent.h::              
-* Glibc netdb.h::               
-* Glibc netinet/ether.h::       
-* Glibc netinet/in.h::          
-* Glibc obstack.h::             
-* Glibc printf.h::              
-* Glibc pthread.h::             
-* Glibc pwd.h::                 
-* Glibc regex.h::               
-* Glibc regexp.h::              
-* Glibc resolv.h::              
-* Glibc rpc/auth.h::            
-* Glibc rpc/auth_des.h::        
-* Glibc rpc/auth_unix.h::       
-* Glibc rpc/clnt.h::            
-* Glibc rpc/des_crypt.h::       
-* Glibc rpc/key_prot.h::        
-* Glibc rpc/netdb.h::           
-* Glibc rpc/pmap_clnt.h::       
-* Glibc rpc/pmap_prot.h::       
-* Glibc rpc/pmap_rmt.h::        
-* Glibc rpc/rpc_msg.h::         
-* Glibc rpc/svc.h::             
-* Glibc rpc/xdr.h::             
-* Glibc rpcsvc/nislib.h::       
-* Glibc rpcsvc/nis_callback.h::  
-* Glibc rpcsvc/yp.h::           
-* Glibc rpcsvc/yp_prot.h::      
-* Glibc rpcsvc/ypclnt.h::       
-* Glibc rpcsvc/ypupd.h::        
-* Glibc sched.h::               
-* Glibc search.h::              
-* Glibc shadow.h::              
-* Glibc signal.h::              
-* Glibc stdio.h::               
-* Glibc stdlib.h::              
-* Glibc string.h::              
-* Glibc sys/capability.h::      
-* Glibc sys/epoll.h::           
-* Glibc sys/file.h::            
-* Glibc sys/fsuid.h::           
-* Glibc sys/gmon.h::            
-* Glibc sys/io.h and sys/perm.h::              
-* Glibc sys/kdaemon.h::         
-* Glibc sys/klog.h::            
-* Glibc sys/mman.h::            
-* Glibc sys/mount.h::           
-* Glibc sys/personality.h::     
-* Glibc sys/prctl.h::           
-* Glibc sys/profil.h::          
-* Glibc sys/ptrace.h::          
-* Glibc sys/quota.h::           
-* Glibc sys/reboot.h::          
-* Glibc sys/sem.h::             
-* Glibc sys/sendfile.h::        
-* Glibc sys/socket.h::          
-* Glibc sys/stat.h::            
-* Glibc sys/statfs.h::          
-* Glibc sys/swap.h::            
-* Glibc sys/sysctl.h::          
-* Glibc sys/sysinfo.h::         
-* Glibc sys/syslog.h::          
-* Glibc sys/sysmacros.h::       
-* Glibc sys/time.h::            
-* Glibc sys/timex.h::           
-* Glibc sys/ustat.h::           
-* Glibc sys/vlimit.h::          
-* Glibc sys/vm86.h::            
-* Glibc sys/vtimes.h::          
-* Glibc sys/wait.h::            
-* Glibc sys/xattr.h::           
-* Glibc termios.h::             
-* Glibc time.h::                
-* Glibc ttyent.h::              
-* Glibc unistd.h::              
-* Glibc utmp.h::                
-* Glibc utmpx.h::               
-* Glibc wchar.h::               
-* Glibc wctype.h::              
+* Glibc aio.h::
+* Glibc aliases.h::
+* Glibc argp.h::
+* Glibc argz.h::
+* Glibc arpa/inet.h::
+* Glibc byteswap.h::
+* Glibc complex.h::
+* Glibc crypt.h::
+* Glibc ctype.h::
+* Glibc dirent.h::
+* Glibc dlfcn.h::
+* Glibc envz.h::
+* Glibc err.h::
+* Glibc errno.h::
+* Glibc error.h::
+* Glibc execinfo.h::
+* Glibc fcntl.h::
+* Glibc fenv.h::
+* Glibc fmtmsg.h::
+* Glibc fstab.h::
+* Glibc fts.h::
+* Glibc getopt.h::
+* Glibc glob.h::
+* Glibc gnu/libc-version.h::
+* Glibc grp.h::
+* Glibc ifaddrs.h::
+* Glibc langinfo.h::
+* Glibc libintl.h::
+* Glibc link.h::
+* Glibc locale.h::
+* Glibc malloc.h::
+* Glibc math.h::
+* Glibc mcheck.h::
+* Glibc monetary.h::
+* Glibc mntent.h::
+* Glibc netdb.h::
+* Glibc netinet/ether.h::
+* Glibc netinet/in.h::
+* Glibc obstack.h::
+* Glibc printf.h::
+* Glibc pthread.h::
+* Glibc pwd.h::
+* Glibc regex.h::
+* Glibc regexp.h::
+* Glibc resolv.h::
+* Glibc rpc/auth.h::
+* Glibc rpc/auth_des.h::
+* Glibc rpc/auth_unix.h::
+* Glibc rpc/clnt.h::
+* Glibc rpc/des_crypt.h::
+* Glibc rpc/key_prot.h::
+* Glibc rpc/netdb.h::
+* Glibc rpc/pmap_clnt.h::
+* Glibc rpc/pmap_prot.h::
+* Glibc rpc/pmap_rmt.h::
+* Glibc rpc/rpc_msg.h::
+* Glibc rpc/svc.h::
+* Glibc rpc/xdr.h::
+* Glibc rpcsvc/nislib.h::
+* Glibc rpcsvc/nis_callback.h::
+* Glibc rpcsvc/yp.h::
+* Glibc rpcsvc/yp_prot.h::
+* Glibc rpcsvc/ypclnt.h::
+* Glibc rpcsvc/ypupd.h::
+* Glibc sched.h::
+* Glibc search.h::
+* Glibc shadow.h::
+* Glibc signal.h::
+* Glibc stdio.h::
+* Glibc stdlib.h::
+* Glibc string.h::
+* Glibc sys/capability.h::
+* Glibc sys/epoll.h::
+* Glibc sys/file.h::
+* Glibc sys/fsuid.h::
+* Glibc sys/gmon.h::
+* Glibc sys/io.h and sys/perm.h::
+* Glibc sys/kdaemon.h::
+* Glibc sys/klog.h::
+* Glibc sys/mman.h::
+* Glibc sys/mount.h::
+* Glibc sys/personality.h::
+* Glibc sys/prctl.h::
+* Glibc sys/profil.h::
+* Glibc sys/ptrace.h::
+* Glibc sys/quota.h::
+* Glibc sys/reboot.h::
+* Glibc sys/sem.h::
+* Glibc sys/sendfile.h::
+* Glibc sys/socket.h::
+* Glibc sys/stat.h::
+* Glibc sys/statfs.h::
+* Glibc sys/swap.h::
+* Glibc sys/sysctl.h::
+* Glibc sys/sysinfo.h::
+* Glibc sys/syslog.h::
+* Glibc sys/sysmacros.h::
+* Glibc sys/time.h::
+* Glibc sys/timex.h::
+* Glibc sys/ustat.h::
+* Glibc sys/vlimit.h::
+* Glibc sys/vm86.h::
+* Glibc sys/vtimes.h::
+* Glibc sys/wait.h::
+* Glibc sys/xattr.h::
+* Glibc termios.h::
+* Glibc time.h::
+* Glibc ttyent.h::
+* Glibc unistd.h::
+* Glibc utmp.h::
+* Glibc utmpx.h::
+* Glibc wchar.h::
+* Glibc wctype.h::
 @end menu
 
 @c @node Glibc a.out.h
@@ -5085,6 +5090,9 @@ This list of functions is sorted according to the header that declares them.
 @include glibc-functions/ioperm.texi
 @include glibc-functions/iopl.texi
 
+@c @node Glibc sys/ioctl.h
+@c @section Glibc @code{<sys/ioctl.h>}
+
 @c @node Glibc sys/ipc.h
 @c @section Glibc Extensions to @code{<sys/ipc.h>}
 
@@ -5826,23 +5834,8 @@ generated automatically.
 
 @include regexprops-generic.texi
 
-@node func
-@section func
-
-The @code{func} module makes sure that you can use the predefined
-identifier @code{__func__} as defined by C99 in your code.
+@include func.texi
 
-A small example is:
-
-@smallexample
-#include <config.h>
-#include <stdio.h> /* for printf */
-
-int main (void)
-@{
-    printf ("%s: hello world\n", __func__);
-@}
-@end smallexample
 
 @node GNU Free Documentation License
 @appendix GNU Free Documentation License