# g++ needs a lot of definitions to see the same set of
# prototypes from <unistd.h> et alia as cxx/cc see.
+# Note that we cannot define _XOPEN_SOURCE_EXTENDED or
+# its moral equivalent, _XOPEN_SOURCE=500 (which would
+# define a lot of the required prototypes for us), because
+# the gcc-processed version of <sys/wait.h> contains fatally
+# conflicting prototypes for wait3().
case "$cc" in
*g++*) ccflags="$ccflags -D_XOPEN_SOURCE -D_OSF_SOURCE -D_AES_SOURCE -D_BSD -D_POSIX_C_SOURCE=199309L -D_POSIX_PII_SOCKET" ;;
esac
# endif
#endif
+#if defined(__osf__) && defined(__cplusplus) && !defined(_XOPEN_SOURCE_EXTENDED)
+EXTERN_C int fchdir(int);
+EXTERN_C int flock(int, int);
+EXTERN_C int fseeko(FILE *, off_t, int);
+EXTERN_C off_t ftello(FILE *);
+#endif
+
#ifdef SETERRNO
# undef SETERRNO /* SOCKS might have defined this */
#endif
void endservent(void);
#endif
-#if defined(__osf__) && defined(__cplusplus) && !defined(_XOPEN_SOURCE_EXTENDED)
-extern int readlink(const char *, char *, size_t);
-extern int fchdir(int);
-#endif
-
#undef PERL_EFF_ACCESS /* EFFective uid/gid ACCESS */
/* AIX 5.2 and below use mktime for localtime, and defines the edge case