summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2012-09-26 08:33:20 +0100
committerSteve Hay <steve.m.hay@googlemail.com>2012-09-26 08:33:34 +0100
commite37d7e38fe022990bbf0ce90dc77f411ebeb158a (patch)
treebe2fd3d2e2bcfd4aa9571e63b21ea8b244bae2b5 /win32
parente9ce9c73d646d9031069b35dd37dd9722353f3f2 (diff)
downloadperl-e37d7e38fe022990bbf0ce90dc77f411ebeb158a.tar.gz
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.
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.h7
1 files changed, 5 insertions, 2 deletions
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