[cares] Allow compilation on host and from Fuchsia

Change-Id: Ib7031111efdc8200dfbcab438986093554b09899
diff --git a/ares_config.h b/ares_config.h
index f8fe094..02d1f82 100644
--- a/ares_config.h
+++ b/ares_config.h
@@ -17,7 +17,7 @@
 #define CARES_SYMBOL_HIDING 1
 
 /* Definition to make a library symbol externally visible. */
-#define CARES_SYMBOL_SCOPE_EXTERN __attribute__ ((__visibility__ ("default")))
+#define CARES_SYMBOL_SCOPE_EXTERN __attribute__((__visibility__("default")))
 
 /* the signed version of size_t */
 #define CARES_TYPEOF_ARES_SSIZE_T ssize_t
@@ -58,11 +58,13 @@
 /* Define to 1 if you have the <arpa/inet.h> header file. */
 #define HAVE_ARPA_INET_H 1
 
+#ifdef __Fuchsia__
 /* Define to 1 if you have the <arpa/nameser_compat.h> header file. */
 #define HAVE_ARPA_NAMESER_COMPAT_H 1
 
 /* Define to 1 if you have the <arpa/nameser.h> header file. */
 #define HAVE_ARPA_NAMESER_H 1
+#endif
 
 /* Define to 1 if you have the <assert.h> header file. */
 #define HAVE_ASSERT_H 1
@@ -73,8 +75,10 @@
 /* Define to 1 if bool is an available type. */
 #define HAVE_BOOL_T 1
 
+#ifdef __Fuchsia__
 /* Define to 1 if you have the clock_gettime function and monotonic timer. */
 #define HAVE_CLOCK_GETTIME_MONOTONIC 1
+#endif
 
 /* Define to 1 if you have the closesocket function. */
 /* #undef HAVE_CLOSESOCKET */
@@ -115,6 +119,7 @@
 /* Define to 1 if you have the getenv function. */
 #define HAVE_GETENV 1
 
+#ifdef __Fuchsia__
 /* Define to 1 if you have the gethostbyaddr function. */
 #define HAVE_GETHOSTBYADDR 1
 
@@ -129,6 +134,7 @@
 
 /* Define to 1 if you have the getservbyport_r function. */
 #define HAVE_GETSERVBYPORT_R 1
+#endif
 
 /* Define to 1 if you have the `gettimeofday' function. */
 #define HAVE_GETTIMEOFDAY 1
@@ -158,7 +164,7 @@
 /* #undef HAVE_IOCTLSOCKET_CAMEL */
 
 /* Define to 1 if you have a working IoctlSocket camel case FIONBIO function.
-   */
+ */
 /* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */
 
 /* Define to 1 if you have a working ioctlsocket FIONBIO function. */
@@ -230,8 +236,10 @@
 /* Define to 1 if sig_atomic_t is already defined as volatile. */
 /* #undef HAVE_SIG_ATOMIC_T_VOLATILE */
 
+#ifdef __Fuchsia__
 /* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */
 #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
+#endif
 
 /* Define to 1 if you have the socket function. */
 #define HAVE_SOCKET 1
@@ -254,8 +262,10 @@
 /* Define to 1 if you have the strcmpi function. */
 /* #undef HAVE_STRCMPI */
 
+#ifdef __Fuchsia__
 /* Define to 1 if you have the strdup function. */
 #define HAVE_STRDUP 1
+#endif
 
 /* Define to 1 if you have the stricmp function. */
 /* #undef HAVE_STRICMP */
@@ -339,7 +349,7 @@
 /* #undef HAVE_WS2TCPIP_H */
 
 /* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
+ */
 #define LT_OBJDIR ".libs/"
 
 /* Define to 1 if you need the malloc.h header file even with stdlib.h */
@@ -363,6 +373,19 @@
 #else
 #error Unsupported architecture
 #endif
+#elif defined(__linux__)
+#if defined(__x86_64__)
+#define OS "x86_64-unknown-linux"
+#define _BSD_SOURCE
+#else
+#error Unsupported architecture
+#endif
+#elif defined(__APPLE__) && defined(__MACH__)
+#if defined(__x86_64__)
+#define OS "x86_64-unknown-linux"
+#else
+#error Unsupported architecture
+#endif
 #else
 #error Unsupported OS
 #endif
@@ -371,7 +394,8 @@
 #define PACKAGE "c-ares"
 
 /* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares"
+#define PACKAGE_BUGREPORT \
+    "c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares"
 
 /* Define to the full name of this package. */
 #define PACKAGE_NAME "c-ares"
@@ -478,13 +502,13 @@
 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
    significant byte first (like Motorola and SPARC, unlike Intel). */
 #if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-#  define WORDS_BIGENDIAN 1
-# endif
+#if defined __BIG_ENDIAN__
+#define WORDS_BIGENDIAN 1
+#endif
 #else
-# ifndef WORDS_BIGENDIAN
+#ifndef WORDS_BIGENDIAN
 /* #  undef WORDS_BIGENDIAN */
-# endif
+#endif
 #endif
 
 /* Define to 1 if OS is AIX. */
@@ -494,7 +518,7 @@
 
 /* Enable large inode numbers on Mac OS X 10.5.  */
 #ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
+#define _DARWIN_USE_64_BIT_INODE 1
 #endif
 
 /* Number of bits in a file offset, on hosts where this is settable. */
diff --git a/setup_once.h b/setup_once.h
index a8cfe6b..acbcb6b 100644
--- a/setup_once.h
+++ b/setup_once.h
@@ -1,7 +1,6 @@
 #ifndef __SETUP_ONCE_H
 #define __SETUP_ONCE_H
 
-
 /* Copyright (C) 2004 - 2013 by Daniel Stenberg et al
  *
  * Permission to use, copy, modify, and distribute this software and its
@@ -15,7 +14,6 @@
  * without express or implied warranty.
  */
 
-
 /********************************************************************
  *                              NOTICE                              *
  *                             ========                             *
@@ -25,16 +23,16 @@
  *                                                                  *
  ********************************************************************/
 
-
 /*
  * Inclusion of common header files.
  */
 
+#include <stdarg.h>
+
+#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdarg.h>
-#include <ctype.h>
 
 #ifdef HAVE_ERRNO_H
 #include <errno.h>
@@ -68,8 +66,8 @@
 #endif
 
 #ifdef WIN32
-#include <io.h>
 #include <fcntl.h>
+#include <io.h>
 #endif
 
 #if defined(HAVE_STDBOOL_H) && defined(HAVE_BOOL_T)
@@ -81,14 +79,14 @@
 #endif
 
 #ifdef __hpux
-#  if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL)
-#    ifdef _APP32_64BIT_OFF_T
-#      define OLD_APP32_64BIT_OFF_T _APP32_64BIT_OFF_T
-#      undef _APP32_64BIT_OFF_T
-#    else
-#      undef OLD_APP32_64BIT_OFF_T
-#    endif
-#  endif
+#if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL)
+#ifdef _APP32_64BIT_OFF_T
+#define OLD_APP32_64BIT_OFF_T _APP32_64BIT_OFF_T
+#undef _APP32_64BIT_OFF_T
+#else
+#undef OLD_APP32_64BIT_OFF_T
+#endif
+#endif
 #endif
 
 #ifdef HAVE_SYS_SOCKET_H
@@ -96,14 +94,13 @@
 #endif
 
 #ifdef __hpux
-#  if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL)
-#    ifdef OLD_APP32_64BIT_OFF_T
-#      define _APP32_64BIT_OFF_T OLD_APP32_64BIT_OFF_T
-#      undef OLD_APP32_64BIT_OFF_T
-#    endif
-#  endif
+#if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL)
+#ifdef OLD_APP32_64BIT_OFF_T
+#define _APP32_64BIT_OFF_T OLD_APP32_64BIT_OFF_T
+#undef OLD_APP32_64BIT_OFF_T
 #endif
-
+#endif
+#endif
 
 /*
  * Definition of timeval struct for platforms that don't have it.
@@ -111,12 +108,11 @@
 
 #ifndef HAVE_STRUCT_TIMEVAL
 struct timeval {
- long tv_sec;
- long tv_usec;
+  long tv_sec;
+  long tv_usec;
 };
 #endif
 
-
 /*
  * If we have the MSG_NOSIGNAL define, make sure we use
  * it as the fourth argument of function send()
@@ -128,12 +124,11 @@
 #define SEND_4TH_ARG 0
 #endif
 
-
 #if defined(__minix)
 /* Minix doesn't support recv on TCP sockets */
-#define sread(x,y,z) (ares_ssize_t)read((RECV_TYPE_ARG1)(x), \
-                                   (RECV_TYPE_ARG2)(y), \
-                                   (RECV_TYPE_ARG3)(z))
+#define sread(x, y, z)                                                         \
+  (ares_ssize_t)                                                               \
+      read((RECV_TYPE_ARG1)(x), (RECV_TYPE_ARG2)(y), (RECV_TYPE_ARG3)(z))
 
 #elif defined(HAVE_RECV)
 /*
@@ -158,82 +153,69 @@
  * SEND_TYPE_RETV must also be defined.
  */
 
-#if !defined(RECV_TYPE_ARG1) || \
-    !defined(RECV_TYPE_ARG2) || \
-    !defined(RECV_TYPE_ARG3) || \
-    !defined(RECV_TYPE_ARG4) || \
+#if !defined(RECV_TYPE_ARG1) || !defined(RECV_TYPE_ARG2) ||                    \
+    !defined(RECV_TYPE_ARG3) || !defined(RECV_TYPE_ARG4) ||                    \
     !defined(RECV_TYPE_RETV)
-  /* */
-  Error Missing_definition_of_return_and_arguments_types_of_recv
-  /* */
+/* */
+Error Missing_definition_of_return_and_arguments_types_of_recv
+/* */
 #else
-#define sread(x,y,z) (ares_ssize_t)recv((RECV_TYPE_ARG1)(x), \
-                                   (RECV_TYPE_ARG2)(y), \
-                                   (RECV_TYPE_ARG3)(z), \
-                                   (RECV_TYPE_ARG4)(0))
+#define sread(x, y, z)                                                         \
+  (ares_ssize_t) recv((RECV_TYPE_ARG1)(x), (RECV_TYPE_ARG2)(y),                \
+                      (RECV_TYPE_ARG3)(z), (RECV_TYPE_ARG4)(0))
 #endif
 #else /* HAVE_RECV */
 #ifndef sread
-  /* */
-  Error Missing_definition_of_macro_sread
-  /* */
+/* */
+Error Missing_definition_of_macro_sread
+/* */
 #endif
 #endif /* HAVE_RECV */
 
-
 #if defined(__minix)
 /* Minix doesn't support send on TCP sockets */
-#define swrite(x,y,z) (ares_ssize_t)write((SEND_TYPE_ARG1)(x), \
-                                    (SEND_TYPE_ARG2)(y), \
-                                    (SEND_TYPE_ARG3)(z))
+#define swrite(x, y, z)                                                        \
+  (ares_ssize_t)                                                               \
+      write((SEND_TYPE_ARG1)(x), (SEND_TYPE_ARG2)(y), (SEND_TYPE_ARG3)(z))
 
 #elif defined(HAVE_SEND)
-#if !defined(SEND_TYPE_ARG1) || \
-    !defined(SEND_QUAL_ARG2) || \
-    !defined(SEND_TYPE_ARG2) || \
-    !defined(SEND_TYPE_ARG3) || \
-    !defined(SEND_TYPE_ARG4) || \
-    !defined(SEND_TYPE_RETV)
-  /* */
-  Error Missing_definition_of_return_and_arguments_types_of_send
-  /* */
+#if !defined(SEND_TYPE_ARG1) || !defined(SEND_QUAL_ARG2) ||                    \
+    !defined(SEND_TYPE_ARG2) || !defined(SEND_TYPE_ARG3) ||                    \
+    !defined(SEND_TYPE_ARG4) || !defined(SEND_TYPE_RETV)
+    /* */
+    Error Missing_definition_of_return_and_arguments_types_of_send
+/* */
 #else
-#define swrite(x,y,z) (ares_ssize_t)send((SEND_TYPE_ARG1)(x), \
-                                    (SEND_TYPE_ARG2)(y), \
-                                    (SEND_TYPE_ARG3)(z), \
-                                    (SEND_TYPE_ARG4)(SEND_4TH_ARG))
+#define swrite(x, y, z)                                                        \
+  (ares_ssize_t) send((SEND_TYPE_ARG1)(x), (SEND_TYPE_ARG2)(y),                \
+                      (SEND_TYPE_ARG3)(z), (SEND_TYPE_ARG4)(SEND_4TH_ARG))
 #endif
 #else /* HAVE_SEND */
 #ifndef swrite
-  /* */
-  Error Missing_definition_of_macro_swrite
-  /* */
+    /* */
+    Error Missing_definition_of_macro_swrite
+/* */
 #endif
 #endif /* HAVE_SEND */
 
-
 #if 0
 #if defined(HAVE_RECVFROM)
 /*
  * Currently recvfrom is only used on udp sockets.
  */
-#if !defined(RECVFROM_TYPE_ARG1) || \
-    !defined(RECVFROM_TYPE_ARG2) || \
-    !defined(RECVFROM_TYPE_ARG3) || \
-    !defined(RECVFROM_TYPE_ARG4) || \
-    !defined(RECVFROM_TYPE_ARG5) || \
-    !defined(RECVFROM_TYPE_ARG6) || \
+#if !defined(RECVFROM_TYPE_ARG1) || !defined(RECVFROM_TYPE_ARG2) ||            \
+    !defined(RECVFROM_TYPE_ARG3) || !defined(RECVFROM_TYPE_ARG4) ||            \
+    !defined(RECVFROM_TYPE_ARG5) || !defined(RECVFROM_TYPE_ARG6) ||            \
     !defined(RECVFROM_TYPE_RETV)
   /* */
   Error Missing_definition_of_return_and_arguments_types_of_recvfrom
   /* */
 #else
-#define sreadfrom(s,b,bl,f,fl) (ares_ssize_t)recvfrom((RECVFROM_TYPE_ARG1)  (s),  \
-                                                 (RECVFROM_TYPE_ARG2 *)(b),  \
-                                                 (RECVFROM_TYPE_ARG3)  (bl), \
-                                                 (RECVFROM_TYPE_ARG4)  (0),  \
-                                                 (RECVFROM_TYPE_ARG5 *)(f),  \
-                                                 (RECVFROM_TYPE_ARG6 *)(fl))
+#define sreadfrom(s, b, bl, f, fl)                                             \
+  (ares_ssize_t)                                                               \
+      recvfrom((RECVFROM_TYPE_ARG1)(s), (RECVFROM_TYPE_ARG2 *)(b),             \
+               (RECVFROM_TYPE_ARG3)(bl), (RECVFROM_TYPE_ARG4)(0),              \
+               (RECVFROM_TYPE_ARG5 *)(f), (RECVFROM_TYPE_ARG6 *)(fl))
 #endif
 #else /* HAVE_RECVFROM */
 #ifndef sreadfrom
@@ -243,64 +225,59 @@
 #endif
 #endif /* HAVE_RECVFROM */
 
-
 #ifdef RECVFROM_TYPE_ARG6_IS_VOID
-#  define RECVFROM_ARG6_T int
+#define RECVFROM_ARG6_T int
 #else
-#  define RECVFROM_ARG6_T RECVFROM_TYPE_ARG6
+#define RECVFROM_ARG6_T RECVFROM_TYPE_ARG6
 #endif
 #endif /* if 0 */
 
-
 /*
  * Function-like macro definition used to close a socket.
  */
 
 #if defined(HAVE_CLOSESOCKET)
-#  define sclose(x)  closesocket((x))
+#define sclose(x) closesocket((x))
 #elif defined(HAVE_CLOSESOCKET_CAMEL)
-#  define sclose(x)  CloseSocket((x))
+#define sclose(x) CloseSocket((x))
 #elif defined(HAVE_CLOSE_S)
-#  define sclose(x)  close_s((x))
+#define sclose(x) close_s((x))
 #else
-#  define sclose(x)  close((x))
+#define sclose(x) close((x))
 #endif
 
-
 /*
  * Uppercase macro versions of ANSI/ISO is*() functions/macros which
  * avoid negative number inputs with argument byte codes > 127.
  */
 
-#define ISSPACE(x)  (isspace((int)  ((unsigned char)x)))
-#define ISDIGIT(x)  (isdigit((int)  ((unsigned char)x)))
-#define ISALNUM(x)  (isalnum((int)  ((unsigned char)x)))
-#define ISXDIGIT(x) (isxdigit((int) ((unsigned char)x)))
-#define ISGRAPH(x)  (isgraph((int)  ((unsigned char)x)))
-#define ISALPHA(x)  (isalpha((int)  ((unsigned char)x)))
-#define ISPRINT(x)  (isprint((int)  ((unsigned char)x)))
-#define ISUPPER(x)  (isupper((int)  ((unsigned char)x)))
-#define ISLOWER(x)  (islower((int)  ((unsigned char)x)))
-#define ISASCII(x)  (isascii((int)  ((unsigned char)x)))
+#define ISSPACE(x) (isspace((int)((unsigned char)x)))
+#define ISDIGIT(x) (isdigit((int)((unsigned char)x)))
+#define ISALNUM(x) (isalnum((int)((unsigned char)x)))
+#define ISXDIGIT(x) (isxdigit((int)((unsigned char)x)))
+#define ISGRAPH(x) (isgraph((int)((unsigned char)x)))
+#define ISALPHA(x) (isalpha((int)((unsigned char)x)))
+#define ISPRINT(x) (isprint((int)((unsigned char)x)))
+#define ISUPPER(x) (isupper((int)((unsigned char)x)))
+#define ISLOWER(x) (islower((int)((unsigned char)x)))
+#define ISASCII(x) (isascii((int)((unsigned char)x)))
 
-#define ISBLANK(x)  (int)((((unsigned char)x) == ' ') || \
-                          (((unsigned char)x) == '\t'))
+#define ISBLANK(x)                                                             \
+  (int)((((unsigned char)x) == ' ') || (((unsigned char)x) == '\t'))
 
-#define TOLOWER(x)  (tolower((int)  ((unsigned char)x)))
-
+#define TOLOWER(x) (tolower((int)((unsigned char)x)))
 
 /*
  * 'bool' stuff compatible with HP-UX headers.
  */
 
 #if defined(__hpux) && !defined(HAVE_BOOL_T)
-   typedef int bool;
-#  define false 0
-#  define true 1
-#  define HAVE_BOOL_T
+typedef int bool;
+#define false 0
+#define true 1
+#define HAVE_BOOL_T
 #endif
 
-
 /*
  * 'bool' exists on platforms with <stdbool.h>, i.e. C99 platforms.
  * On non-C99 platforms there's no bool, so define an enum for that.
@@ -309,10 +286,7 @@
  */
 
 #ifndef HAVE_BOOL_T
-  typedef enum {
-      bool_false = 0,
-      bool_true  = 1
-  } bool;
+typedef enum { bool_false = 0, bool_true = 1 } bool;
 
 /*
  * Use a define to let 'true' and 'false' use those enums.  There
@@ -320,12 +294,11 @@
  * there are some in the examples. This will cater for any later
  * code happening to use true and false.
  */
-#  define false bool_false
-#  define true  bool_true
-#  define HAVE_BOOL_T
+#define false bool_false
+#define true bool_true
+#define HAVE_BOOL_T
 #endif
 
-
 /*
  * Redefine TRUE and FALSE too, to catch current use. With this
  * change, 'bool found = 1' will give a warning on MIPSPro, but
@@ -340,27 +313,23 @@
 #define FALSE false
 #endif
 
-
 /*
  * Macro WHILE_FALSE may be used to build single-iteration do-while loops,
  * avoiding compiler warnings. Mostly intended for other macro definitions.
  */
 
-#define WHILE_FALSE  while(0)
+#define WHILE_FALSE while (0)
 
 #if defined(_MSC_VER) && !defined(__POCC__)
-#  undef WHILE_FALSE
-#  if (_MSC_VER < 1500)
-#    define WHILE_FALSE  while(1, 0)
-#  else
-#    define WHILE_FALSE \
-__pragma(warning(push)) \
-__pragma(warning(disable:4127)) \
-while(0) \
-__pragma(warning(pop))
-#  endif
+#undef WHILE_FALSE
+#if (_MSC_VER < 1500)
+#define WHILE_FALSE while (1, 0)
+#else
+#define WHILE_FALSE                                                            \
+  __pragma(warning(push)) __pragma(warning(disable : 4127)) while (0)          \
+      __pragma(warning(pop))
 #endif
-
+#endif
 
 /*
  * Typedef to 'int' if sig_atomic_t is not an available 'typedefed' type.
@@ -371,7 +340,6 @@
 #define HAVE_SIG_ATOMIC_T
 #endif
 
-
 /*
  * Convenience SIG_ATOMIC_T definition
  */
@@ -382,7 +350,6 @@
 #define SIG_ATOMIC_T static volatile sig_atomic_t
 #endif
 
-
 /*
  * Default return type for signal handlers.
  */
@@ -391,7 +358,6 @@
 #define RETSIGTYPE void
 #endif
 
-
 /*
  * Macro used to include code only in debug builds.
  */
@@ -399,10 +365,12 @@
 #ifdef DEBUGBUILD
 #define DEBUGF(x) x
 #else
-#define DEBUGF(x) do { } WHILE_FALSE
+#define DEBUGF(x)                                                              \
+  do {                                                                         \
+  }                                                                            \
+  WHILE_FALSE
 #endif
 
-
 /*
  * Macro used to include assertion code only in debug builds.
  */
@@ -410,139 +378,136 @@
 #if defined(DEBUGBUILD) && defined(HAVE_ASSERT_H)
 #define DEBUGASSERT(x) assert(x)
 #else
-#define DEBUGASSERT(x) do { } WHILE_FALSE
+#define DEBUGASSERT(x)                                                         \
+  do {                                                                         \
+  }                                                                            \
+  WHILE_FALSE
 #endif
 
-
 /*
  * Macro SOCKERRNO / SET_SOCKERRNO() returns / sets the *socket-related* errno
  * (or equivalent) on this platform to hide platform details to code using it.
  */
 
 #ifdef USE_WINSOCK
-#define SOCKERRNO         ((int)WSAGetLastError())
-#define SET_SOCKERRNO(x)  (WSASetLastError((int)(x)))
+#define SOCKERRNO ((int)WSAGetLastError())
+#define SET_SOCKERRNO(x) (WSASetLastError((int)(x)))
 #else
-#define SOCKERRNO         (errno)
-#define SET_SOCKERRNO(x)  (errno = (x))
+#define SOCKERRNO (errno)
+#define SET_SOCKERRNO(x) (errno = (x))
 #endif
 
-
 /*
  * Macro ERRNO / SET_ERRNO() returns / sets the NOT *socket-related* errno
  * (or equivalent) on this platform to hide platform details to code using it.
  */
 
 #if defined(WIN32) && !defined(WATT32)
-#define ERRNO         ((int)GetLastError())
-#define SET_ERRNO(x)  (SetLastError((DWORD)(x)))
+#define ERRNO ((int)GetLastError())
+#define SET_ERRNO(x) (SetLastError((DWORD)(x)))
 #else
-#define ERRNO         (errno)
-#define SET_ERRNO(x)  (errno = (x))
+#define ERRNO (errno)
+#define SET_ERRNO(x) (errno = (x))
 #endif
 
-
 /*
  * Portable error number symbolic names defined to Winsock error codes.
  */
 
 #ifdef USE_WINSOCK
-#undef  EBADF            /* override definition in errno.h */
-#define EBADF            WSAEBADF
-#undef  EINTR            /* override definition in errno.h */
-#define EINTR            WSAEINTR
-#undef  EINVAL           /* override definition in errno.h */
-#define EINVAL           WSAEINVAL
-#undef  EWOULDBLOCK      /* override definition in errno.h */
-#define EWOULDBLOCK      WSAEWOULDBLOCK
-#undef  EINPROGRESS      /* override definition in errno.h */
-#define EINPROGRESS      WSAEINPROGRESS
-#undef  EALREADY         /* override definition in errno.h */
-#define EALREADY         WSAEALREADY
-#undef  ENOTSOCK         /* override definition in errno.h */
-#define ENOTSOCK         WSAENOTSOCK
-#undef  EDESTADDRREQ     /* override definition in errno.h */
-#define EDESTADDRREQ     WSAEDESTADDRREQ
-#undef  EMSGSIZE         /* override definition in errno.h */
-#define EMSGSIZE         WSAEMSGSIZE
-#undef  EPROTOTYPE       /* override definition in errno.h */
-#define EPROTOTYPE       WSAEPROTOTYPE
-#undef  ENOPROTOOPT      /* override definition in errno.h */
-#define ENOPROTOOPT      WSAENOPROTOOPT
-#undef  EPROTONOSUPPORT  /* override definition in errno.h */
-#define EPROTONOSUPPORT  WSAEPROTONOSUPPORT
-#define ESOCKTNOSUPPORT  WSAESOCKTNOSUPPORT
-#undef  EOPNOTSUPP       /* override definition in errno.h */
-#define EOPNOTSUPP       WSAEOPNOTSUPP
-#define EPFNOSUPPORT     WSAEPFNOSUPPORT
-#undef  EAFNOSUPPORT     /* override definition in errno.h */
-#define EAFNOSUPPORT     WSAEAFNOSUPPORT
-#undef  EADDRINUSE       /* override definition in errno.h */
-#define EADDRINUSE       WSAEADDRINUSE
-#undef  EADDRNOTAVAIL    /* override definition in errno.h */
-#define EADDRNOTAVAIL    WSAEADDRNOTAVAIL
-#undef  ENETDOWN         /* override definition in errno.h */
-#define ENETDOWN         WSAENETDOWN
-#undef  ENETUNREACH      /* override definition in errno.h */
-#define ENETUNREACH      WSAENETUNREACH
-#undef  ENETRESET        /* override definition in errno.h */
-#define ENETRESET        WSAENETRESET
-#undef  ECONNABORTED     /* override definition in errno.h */
-#define ECONNABORTED     WSAECONNABORTED
-#undef  ECONNRESET       /* override definition in errno.h */
-#define ECONNRESET       WSAECONNRESET
-#undef  ENOBUFS          /* override definition in errno.h */
-#define ENOBUFS          WSAENOBUFS
-#undef  EISCONN          /* override definition in errno.h */
-#define EISCONN          WSAEISCONN
-#undef  ENOTCONN         /* override definition in errno.h */
-#define ENOTCONN         WSAENOTCONN
-#define ESHUTDOWN        WSAESHUTDOWN
-#define ETOOMANYREFS     WSAETOOMANYREFS
-#undef  ETIMEDOUT        /* override definition in errno.h */
-#define ETIMEDOUT        WSAETIMEDOUT
-#undef  ECONNREFUSED     /* override definition in errno.h */
-#define ECONNREFUSED     WSAECONNREFUSED
-#undef  ELOOP            /* override definition in errno.h */
-#define ELOOP            WSAELOOP
-#ifndef ENAMETOOLONG     /* possible previous definition in errno.h */
-#define ENAMETOOLONG     WSAENAMETOOLONG
+#undef EBADF /* override definition in errno.h */
+#define EBADF WSAEBADF
+#undef EINTR /* override definition in errno.h */
+#define EINTR WSAEINTR
+#undef EINVAL /* override definition in errno.h */
+#define EINVAL WSAEINVAL
+#undef EWOULDBLOCK /* override definition in errno.h */
+#define EWOULDBLOCK WSAEWOULDBLOCK
+#undef EINPROGRESS /* override definition in errno.h */
+#define EINPROGRESS WSAEINPROGRESS
+#undef EALREADY /* override definition in errno.h */
+#define EALREADY WSAEALREADY
+#undef ENOTSOCK /* override definition in errno.h */
+#define ENOTSOCK WSAENOTSOCK
+#undef EDESTADDRREQ /* override definition in errno.h */
+#define EDESTADDRREQ WSAEDESTADDRREQ
+#undef EMSGSIZE /* override definition in errno.h */
+#define EMSGSIZE WSAEMSGSIZE
+#undef EPROTOTYPE /* override definition in errno.h */
+#define EPROTOTYPE WSAEPROTOTYPE
+#undef ENOPROTOOPT /* override definition in errno.h */
+#define ENOPROTOOPT WSAENOPROTOOPT
+#undef EPROTONOSUPPORT /* override definition in errno.h */
+#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
+#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
+#undef EOPNOTSUPP /* override definition in errno.h */
+#define EOPNOTSUPP WSAEOPNOTSUPP
+#define EPFNOSUPPORT WSAEPFNOSUPPORT
+#undef EAFNOSUPPORT /* override definition in errno.h */
+#define EAFNOSUPPORT WSAEAFNOSUPPORT
+#undef EADDRINUSE /* override definition in errno.h */
+#define EADDRINUSE WSAEADDRINUSE
+#undef EADDRNOTAVAIL /* override definition in errno.h */
+#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
+#undef ENETDOWN /* override definition in errno.h */
+#define ENETDOWN WSAENETDOWN
+#undef ENETUNREACH /* override definition in errno.h */
+#define ENETUNREACH WSAENETUNREACH
+#undef ENETRESET /* override definition in errno.h */
+#define ENETRESET WSAENETRESET
+#undef ECONNABORTED /* override definition in errno.h */
+#define ECONNABORTED WSAECONNABORTED
+#undef ECONNRESET /* override definition in errno.h */
+#define ECONNRESET WSAECONNRESET
+#undef ENOBUFS /* override definition in errno.h */
+#define ENOBUFS WSAENOBUFS
+#undef EISCONN /* override definition in errno.h */
+#define EISCONN WSAEISCONN
+#undef ENOTCONN /* override definition in errno.h */
+#define ENOTCONN WSAENOTCONN
+#define ESHUTDOWN WSAESHUTDOWN
+#define ETOOMANYREFS WSAETOOMANYREFS
+#undef ETIMEDOUT /* override definition in errno.h */
+#define ETIMEDOUT WSAETIMEDOUT
+#undef ECONNREFUSED /* override definition in errno.h */
+#define ECONNREFUSED WSAECONNREFUSED
+#undef ELOOP /* override definition in errno.h */
+#define ELOOP WSAELOOP
+#ifndef ENAMETOOLONG /* possible previous definition in errno.h */
+#define ENAMETOOLONG WSAENAMETOOLONG
 #endif
-#define EHOSTDOWN        WSAEHOSTDOWN
-#undef  EHOSTUNREACH     /* override definition in errno.h */
-#define EHOSTUNREACH     WSAEHOSTUNREACH
-#ifndef ENOTEMPTY        /* possible previous definition in errno.h */
-#define ENOTEMPTY        WSAENOTEMPTY
+#define EHOSTDOWN WSAEHOSTDOWN
+#undef EHOSTUNREACH /* override definition in errno.h */
+#define EHOSTUNREACH WSAEHOSTUNREACH
+#ifndef ENOTEMPTY /* possible previous definition in errno.h */
+#define ENOTEMPTY WSAENOTEMPTY
 #endif
-#define EPROCLIM         WSAEPROCLIM
-#define EUSERS           WSAEUSERS
-#define EDQUOT           WSAEDQUOT
-#define ESTALE           WSAESTALE
-#define EREMOTE          WSAEREMOTE
+#define EPROCLIM WSAEPROCLIM
+#define EUSERS WSAEUSERS
+#define EDQUOT WSAEDQUOT
+#define ESTALE WSAESTALE
+#define EREMOTE WSAEREMOTE
 #endif
 
-
 /*
  *  Actually use __32_getpwuid() on 64-bit VMS builds for getpwuid()
  */
 
-#if defined(__VMS) && \
-    defined(__INITIAL_POINTER_SIZE) && (__INITIAL_POINTER_SIZE == 64)
+#if defined(__VMS) && defined(__INITIAL_POINTER_SIZE) &&                       \
+    (__INITIAL_POINTER_SIZE == 64)
 #define getpwuid __32_getpwuid
 #endif
 
-
 /*
  * Macro argv_item_t hides platform details to code using it.
  */
 
 #ifdef __VMS
-#define argv_item_t  __char_ptr32
+#define argv_item_t __char_ptr32
 #else
-#define argv_item_t  char *
+#define argv_item_t char *
 #endif
 
-
 /*
  * We use this ZERO_NULL to avoid picky compiler warnings,
  * when assigning a NULL pointer to a function pointer var.
@@ -550,5 +515,4 @@
 
 #define ZERO_NULL 0
 
-
 #endif /* __SETUP_ONCE_H */