X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Ffcntl.in.h;h=8fb7852204fe6e89189e1cb857430de3cf4dec07;hb=6ae551d8480ab63f539bbd23d199f5bf4a9a1264;hp=a1d9e230878f9a3473f60c49d0618495debe0ba4;hpb=c842db5eed5f81fbdb173181599eeb02278a0210;p=gnulib.git diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h index a1d9e2308..8fb785220 100644 --- a/lib/fcntl.in.h +++ b/lib/fcntl.in.h @@ -50,6 +50,8 @@ #endif +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + /* The definition of _GL_ARG_NONNULL is copied here. */ /* The definition of _GL_WARN_ON_USE is copied here. */ @@ -57,18 +59,21 @@ /* Declare overridden functions. */ -#ifdef __cplusplus -extern "C" { -#endif - #if @GNULIB_FCNTL@ # if @REPLACE_FCNTL@ -# undef fcntl -# define fcntl rpl_fcntl -# endif -# if !@HAVE_FCNTL@ || @REPLACE_FCNTL@ -extern int fcntl (int fd, int action, ...); +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fcntl +# define fcntl rpl_fcntl +# endif +_GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...)); +_GL_CXXALIAS_RPL (fcntl, int, (int fd, int action, ...)); +# else +# if !@HAVE_FCNTL@ +_GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...)); +# endif +_GL_CXXALIAS_SYS (fcntl, int, (int fd, int action, ...)); # endif +_GL_CXXALIASWARN (fcntl); #elif defined GNULIB_POSIXCHECK # undef fcntl # if HAVE_RAW_DECL_FCNTL @@ -79,10 +84,17 @@ _GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX compliant - " #if @GNULIB_OPEN@ # if @REPLACE_OPEN@ -# undef open -# define open rpl_open -extern int open (const char *filename, int flags, ...) _GL_ARG_NONNULL ((1)); +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef open +# define open rpl_open +# endif +_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); +# else +_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); # endif +_GL_CXXALIASWARN (open); #elif defined GNULIB_POSIXCHECK # undef open /* Assume open is always declared. */ @@ -92,13 +104,25 @@ _GL_WARN_ON_USE (open, "open is not always POSIX compliant - " #if @GNULIB_OPENAT@ # if @REPLACE_OPENAT@ -# undef openat -# define openat rpl_openat -# endif -# if !@HAVE_OPENAT@ || @REPLACE_OPENAT@ -extern int openat (int fd, char const *file, int flags, /* mode_t mode */ ...) - _GL_ARG_NONNULL ((2)); +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef openat +# define openat rpl_openat +# endif +_GL_FUNCDECL_RPL (openat, int, + (int fd, char const *file, int flags, /* mode_t mode */ ...) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (openat, int, + (int fd, char const *file, int flags, /* mode_t mode */ ...)); +# else +# if !@HAVE_OPENAT@ +_GL_FUNCDECL_SYS (openat, int, + (int fd, char const *file, int flags, /* mode_t mode */ ...) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (openat, int, + (int fd, char const *file, int flags, /* mode_t mode */ ...)); # endif +_GL_CXXALIASWARN (openat); #elif defined GNULIB_POSIXCHECK # undef openat # if HAVE_RAW_DECL_OPENAT @@ -107,9 +131,6 @@ _GL_WARN_ON_USE (openat, "openat is not portable - " # endif #endif -#ifdef __cplusplus -} -#endif /* Fix up the FD_* macros, only known to be missing on mingw. */