Hi,
in what order do I include sys/socket and unistd?
sys_socket.in.h:
#if @HAVE_WINSOCK2_H@ && !defined _GL_UNISTD_H
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
#  undef close
#  define close close_used_without_including_unistd_h
# else
   _GL_WARN_ON_USE (close,
                    "close() used without including <unistd.h>");
# endif
#endif

so, on windows, I must include unistd before sys/socket, otherwise close
will not work.

otoh:
unistd.in.h:
#if @GNULIB_GETHOSTNAME@
/* Get all possible declarations of gethostname().  */
# if @UNISTD_H_HAVE_WINSOCK2_H@
#  if !defined _GL_SYS_SOCKET_H
#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
#    undef socket
#    define socket              socket_used_without_including_sys_socket_h

so I must include sys/socket before unistd, otherwise socket (and many
others) will not work.

so, what is the right order?

-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 
11.0.60900031
http://camera.org http://openvotingconsortium.org http://mideasttruth.com
http://iris.org.il http://pmw.org.il http://www.memritv.org
Lisp: it's here to save your butt.

Reply via email to