Add extern "C" to definitions of four win32_ functions
authorSteve Hay <steve.m.hay@googlemail.com>
Wed, 10 Oct 2012 17:27:07 +0000 (18:27 +0100)
committerSteve Hay <steve.m.hay@googlemail.com>
Wed, 10 Oct 2012 17:27:07 +0000 (18:27 +0100)
This makes them match their declarations in perlhost.h, which fixes linker
errors when linking perl5XX.dll in a C++ build with VC.

win32/perlhost.h
win32/win32.c

index ae422ef..f2bb133 100644 (file)
 #endif
 
 START_EXTERN_C
-extern char *          g_win32_get_privlib(const char *pl, STRLEN *const len);
-extern char *          g_win32_get_sitelib(const char *pl, STRLEN *const len);
-extern char *          g_win32_get_vendorlib(const char *pl,
-                                             STRLEN *const len);
-extern char *          g_getlogin(void);
+extern char *  g_win32_get_privlib(const char *pl, STRLEN *const len);
+extern char *  g_win32_get_sitelib(const char *pl, STRLEN *const len);
+extern char *  g_win32_get_vendorlib(const char *pl, STRLEN *const len);
+extern char *  g_getlogin(void);
 END_EXTERN_C
 
 class CPerlHost
index 603acfe..4427e06 100644 (file)
@@ -381,7 +381,7 @@ get_emd_part(SV **prev_pathp, STRLEN *const len, char *trailing_path, ...)
     return NULL;
 }
 
-char *
+EXTERN_C char *
 win32_get_privlib(const char *pl, STRLEN *const len)
 {
     dTHX;
@@ -439,7 +439,7 @@ win32_get_xlib(const char *pl, const char *xlib, const char *libname,
     return SvPVX(sv1);
 }
 
-char *
+EXTERN_C char *
 win32_get_sitelib(const char *pl, STRLEN *const len)
 {
     return win32_get_xlib(pl, "sitelib", "site", len);
@@ -449,7 +449,7 @@ win32_get_sitelib(const char *pl, STRLEN *const len)
 #  define PERL_VENDORLIB_NAME  "vendor"
 #endif
 
-char *
+EXTERN_C char *
 win32_get_vendorlib(const char *pl, STRLEN *const len)
 {
     return win32_get_xlib(pl, "vendorlib", PERL_VENDORLIB_NAME, len);
@@ -1109,7 +1109,7 @@ setgid(gid_t agid)
     return (agid == ROOT_GID ? 0 : -1);
 }
 
-char *
+EXTERN_C char *
 getlogin(void)
 {
     dTHX;