~ubuntu-branches/ubuntu/oneiric/gnutls26/oneiric

« back to all changes in this revision

Viewing changes to gl/sys_select.in.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-05-20 13:07:18 UTC
  • mfrom: (12.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20110520130718-db41dybbanzfvlji
Tags: 2.10.5-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Fix build failure with --no-add-needed.
  - Build for multiarch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Substitute for <sys/select.h>.
2
 
   Copyright (C) 2007-2009 Free Software Foundation, Inc.
 
2
   Copyright (C) 2007-2010 Free Software Foundation, Inc.
3
3
 
4
4
   This program is free software; you can redistribute it and/or modify
5
5
   it under the terms of the GNU General Public License as published by
42
42
# include <sys/types.h>
43
43
 
44
44
/* On OSF/1 4.0, <sys/select.h> provides only a forward declaration
45
 
   of 'struct timeval', and no definition of this type..  */
46
 
# include <sys/time.h>
 
45
   of 'struct timeval', and no definition of this type.
 
46
   But avoid namespace pollution on glibc systems.  */
 
47
# ifndef __GLIBC__
 
48
#  include <sys/time.h>
 
49
# endif
 
50
 
 
51
/* On Solaris 10, <sys/select.h> provides an FD_ZERO implementation
 
52
   that relies on memset(), but without including <string.h>.
 
53
   But avoid namespace pollution on glibc systems.  */
 
54
# ifndef __GLIBC__
 
55
#  include <string.h>
 
56
# endif
47
57
 
48
58
/* The include_next requires a split double-inclusion guard.  */
49
59
# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
53
63
#ifndef _GL_SYS_SELECT_H
54
64
#define _GL_SYS_SELECT_H
55
65
 
56
 
#if !@HAVE_SYS_SELECT_H@
57
 
 
 
66
#if !@HAVE_SYS_SELECT_H@ || @REPLACE_SELECT@
58
67
/* A platform that lacks <sys/select.h>.  */
59
 
 
60
68
# include <sys/socket.h>
61
 
 
62
 
/* The definition of GL_LINK_WARNING is copied here.  */
63
 
 
64
 
# ifdef __cplusplus
65
 
extern "C" {
66
 
# endif
67
 
 
68
 
# if @GNULIB_SELECT@
69
 
#  if @HAVE_WINSOCK2_H@ || @REPLACE_SELECT@
 
69
#endif
 
70
 
 
71
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
72
 
 
73
/* The definition of _GL_WARN_ON_USE is copied here.  */
 
74
 
 
75
 
 
76
#if @GNULIB_SELECT@
 
77
# if @HAVE_WINSOCK2_H@ || @REPLACE_SELECT@
 
78
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
70
79
#   undef select
71
80
#   define select rpl_select
72
 
extern int rpl_select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
73
81
#  endif
74
 
# elif @HAVE_WINSOCK2_H@
75
 
#  undef select
76
 
#  define select select_used_without_requesting_gnulib_module_select
77
 
# elif defined GNULIB_POSIXCHECK
78
 
#  undef select
79
 
#  define select(n,r,w,e,t) \
80
 
     (GL_LINK_WARNING ("select is not always POSIX compliant - " \
81
 
                       "use gnulib module select for portability"), \
82
 
      select (n, r, w, e, t))
83
 
# endif
84
 
 
85
 
# ifdef __cplusplus
86
 
}
87
 
# endif
88
 
 
 
82
_GL_FUNCDECL_RPL (select, int,
 
83
                  (int, fd_set *, fd_set *, fd_set *, struct timeval *));
 
84
_GL_CXXALIAS_RPL (select, int,
 
85
                  (int, fd_set *, fd_set *, fd_set *, struct timeval *));
 
86
# else
 
87
_GL_CXXALIAS_SYS (select, int,
 
88
                  (int, fd_set *, fd_set *, fd_set *, struct timeval *));
 
89
# endif
 
90
_GL_CXXALIASWARN (select);
 
91
#elif @HAVE_WINSOCK2_H@
 
92
# undef select
 
93
# define select select_used_without_requesting_gnulib_module_select
 
94
#elif defined GNULIB_POSIXCHECK
 
95
# undef select
 
96
# if HAVE_RAW_DECL_SELECT
 
97
_GL_WARN_ON_USE (select, "select is not always POSIX compliant - "
 
98
                 "use gnulib module select for portability");
 
99
# endif
89
100
#endif
90
101
 
 
102
 
91
103
#endif /* _GL_SYS_SELECT_H */
92
104
#endif /* _GL_SYS_SELECT_H */
93
105
#endif /* OSF/1 */