* m4/fchdir.m4 (gl_FUNC_FCHDIR): Likewise.
[gnulib.git] / lib / sys_socket_.h
index 7ad5bca..c25b6ab 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#ifndef _GL_SYS_SOCKET_H
-#define _GL_SYS_SOCKET_H
-
 /* This file is supposed to be used on platforms that lack <sys/socket.h>
    and on platforms where <sys/socket.h> cannot be included standalone.
    It is intended to provide definitions and prototypes needed by an
    application.  */
 
+#ifndef _GL_SYS_SOCKET_H
+
 #if @HAVE_SYS_SOCKET_H@
 
 /* On many platforms, <sys/socket.h> assumes prior inclusion of
    <sys/types.h>.  */
-
 # include <sys/types.h>
 
-# if @HAVE_INCLUDE_NEXT@
-#  include_next <sys/socket.h>
-# else
-#  include @ABSOLUTE_SYS_SOCKET_H@
-# endif
+/* The include_next requires a split double-inclusion guard.  */
+# @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
+
+#endif
+
+#ifndef _GL_SYS_SOCKET_H
+#define _GL_SYS_SOCKET_H
 
-#else
+#if !@HAVE_SYS_SOCKET_H@
 
 /* A platform that lacks <sys/socket.h>.
 
@@ -88,3 +88,4 @@
 #endif /* HAVE_SYS_SOCKET_H */
 
 #endif /* _GL_SYS_SOCKET_H */
+#endif /* _GL_SYS_SOCKET_H */