From e37d7e38fe022990bbf0ce90dc77f411ebeb158a Mon Sep 17 00:00:00 2001 From: Steve Hay Date: Wed, 26 Sep 2012 08:33:20 +0100 Subject: Stop declaring non-exported externs to non-core XS modules [perl #114516] Hide the perl.h declarations of gete?[ug]id and getlogin on Win32 since they are already declared in win32/win32.h, nearer to their definitions (stub functions for UNIX compatibility) in win32/win32.c. Also only declare them, and kill(pg)?, sbrk, chown and mkstemp, under PERL_CORE anyway since they are not exported: including declarations for non-exported functions just hides compiler errors about the symbols being undefined, which doesn't help when trying to fix subsequent errors from the linker about the symbols being unresolved. (Actually, all but sbrk, chown and mkstemp get indirected through the perlhost layer normally anyway, but it doesn't hurt to still hide the declarations, and helps in the case of PERL_IMPLICIT_SYS not being defined, where only kill is redefined to something which is exported.) The declarations of the set[ug]id stub functions remain for now because those two symbols are currently exported. --- win32/win32.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'win32') diff --git a/win32/win32.h b/win32/win32.h index 7ac70ad74c..93331c0aef 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -265,12 +265,14 @@ START_EXTERN_C /* For UNIX compatibility. */ +extern int setuid(uid_t uid); +extern int setgid(gid_t gid); + +#ifdef PERL_CORE extern uid_t getuid(void); extern gid_t getgid(void); extern uid_t geteuid(void); extern gid_t getegid(void); -extern int setuid(uid_t uid); -extern int setgid(gid_t gid); extern int kill(int pid, int sig); extern int killpg(int pid, int sig); #ifndef USE_PERL_SBRK @@ -280,6 +282,7 @@ extern void *sbrk(ptrdiff_t need); extern char * getlogin(void); extern int chown(const char *p, uid_t o, gid_t g); extern int mkstemp(const char *path); +#endif #undef Stat #define Stat win32_stat -- cgit v1.2.1