warn-on-use: use instead of link-warning
[pspp] / lib / sys_ioctl.in.h
index dfcb54e1a447be601239438c7081a74f9c5ce02d..05f28da6cd98e420cbbac64f42aeedbf725d1b41 100644 (file)
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <sys/ioctl.h>.
-   Copyright (C) 2008-2009 Free Software Foundation, Inc.
+   Copyright (C) 2008-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #define _GL_SYS_IOCTL_H
 
 /* AIX 5.1 and Solaris 10 declare ioctl() in <unistd.h> and in <stropts.h>,
-   but not in <sys/ioctl.h>.  */
-#include <unistd.h>
+   but not in <sys/ioctl.h>.
+   But avoid namespace pollution on glibc systems.  */
+#ifndef __GLIBC__
+# include <unistd.h>
+#endif
 
-/* The definition of GL_LINK_WARNING is copied here.  */
+/* The definition of _GL_WARN_ON_USE is copied here.  */
 
 
 /* Declare overridden functions.  */
@@ -54,10 +57,10 @@ extern int ioctl (int fd, int request, ... /* {void *,char *} arg */);
 # define ioctl ioctl_used_without_requesting_gnulib_module_ioctl
 #elif defined GNULIB_POSIXCHECK
 # undef ioctl
-# define ioctl \
-    (GL_LINK_WARNING ("ioctl does not portably work on sockets - " \
-                      "use gnulib module ioctl for portability"), \
-     ioctl)
+# if HAVE_RAW_DECL_IOCTL
+_GL_WARN_ON_USE (ioctl, "ioctl does not portably work on sockets - "
+                 "use gnulib module ioctl for portability");
+# endif
 #endif