In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/e37d7e38fe022990bbf0ce90dc77f411ebeb158a?hp=e9ce9c73d646d9031069b35dd37dd9722353f3f2>

- Log -----------------------------------------------------------------
commit e37d7e38fe022990bbf0ce90dc77f411ebeb158a
Author: Steve Hay <[email protected]>
Date:   Wed Sep 26 08:33:20 2012 +0100

    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.
-----------------------------------------------------------------------

Summary of changes:
 perl.h        |    8 +++++---
 win32/win32.h |    7 +++++--
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/perl.h b/perl.h
index 2f5e868..bf96a8e 100644
--- a/perl.h
+++ b/perl.h
@@ -3596,7 +3596,7 @@ long vtohl(long n);
 #endif
 
 #ifndef __cplusplus
-#if !(defined(UNDER_CE) || defined(SYMBIAN))
+#if !(defined(WIN32) || defined(UNDER_CE) || defined(SYMBIAN))
 Uid_t getuid (void);
 Uid_t geteuid (void);
 Gid_t getgid (void);
@@ -3993,9 +3993,11 @@ Off_t lseek (int,Off_t,int);
 #      endif
 #    endif
 #  endif /* !DONT_DECLARE_STD */
-#ifndef getlogin
+#  ifndef WIN32
+#    ifndef getlogin
 char *getlogin (void);
-#endif
+#    endif
+#  endif /* !WIN32 */
 #endif /* !__cplusplus */
 
 /* Fixme on VMS.  This needs to be a run-time, not build time options */
diff --git a/win32/win32.h b/win32/win32.h
index 7ac70ad..93331c0 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

--
Perl5 Master Repository

Reply via email to