X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/72e6b643d040f276d474b709b942bdd8d03bc2a2..b4e787b95c5d1ac12ba97c5519a1967fc674e4f6:/win32/win32.h diff --git a/win32/win32.h b/win32/win32.h index 918b489..3065867 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -13,6 +13,38 @@ # define _WIN32_WINNT 0x0500 /* needed for CreateHardlink() etc. */ #endif +#ifdef PERL_IS_MINIPERL +/* this macro will remove Winsock only on miniperl, PERL_IMPLICIT_SYS and + * makedef.pl create dependencies that will keep Winsock linked in even with + * this macro defined, even though sockets will be umimplemented from a script + * level in full perl + */ +# define WIN32_NO_SOCKETS +#endif + +#ifdef WIN32_NO_SOCKETS +# undef HAS_SOCKET +# undef HAS_GETPROTOBYNAME +# undef HAS_GETPROTOBYNUMBER +# undef HAS_GETPROTOENT +# undef HAS_GETNETBYNAME +# undef HAS_GETNETBYADDR +# undef HAS_GETNETENT +# undef HAS_GETSERVBYNAME +# undef HAS_GETSERVBYPORT +# undef HAS_GETSERVENT +# undef HAS_GETHOSTBYNAME +# undef HAS_GETHOSTBYADDR +# undef HAS_GETHOSTENT +# undef HAS_SELECT +# undef HAS_IOCTL +# undef HAS_NTOHL +# undef HAS_HTONL +# undef HAS_HTONS +# undef HAS_NTOHS +# define WIN32SCK_IS_STDSCK +#endif + #if defined(PERL_IMPLICIT_SYS) # define DYNAMIC_ENV_FETCH # define HAS_GETENV_LEN @@ -46,11 +78,15 @@ */ /* now even GCC supports __declspec() */ - -#if defined(PERLDLL) -#define DllExport __declspec(dllexport) +/* miniperl has no reason to export anything */ +#if defined(PERL_IS_MINIPERL) && !defined(UNDER_CE) && defined(_MSC_VER) +# define DllExport #else -#define DllExport __declspec(dllimport) +# if defined(PERLDLL) +# define DllExport __declspec(dllexport) +# else +# define DllExport __declspec(dllimport) +# endif #endif /* The Perl APIs can only be called directly inside the perl5xx.dll. @@ -80,6 +116,11 @@ # endif #endif +#ifdef _MSC_VER +# define PERL_STATIC_NO_RET __declspec(noreturn) static +# define PERL_STATIC_INLINE_NO_RET __declspec(noreturn) PERL_STATIC_INLINE +#endif + #define WIN32_LEAN_AND_MEAN #include @@ -157,8 +198,10 @@ struct utsname { #define OP_BINARY O_BINARY /* mistake in in pp_sys.c? */ /* read() and write() aren't transparent for socket handles */ -#define PERL_SOCK_SYSREAD_IS_RECV -#define PERL_SOCK_SYSWRITE_IS_SEND +#ifndef WIN32_NO_SOCKETS +# define PERL_SOCK_SYSREAD_IS_RECV +# define PERL_SOCK_SYSWRITE_IS_SEND +#endif #define PERL_NO_FORCE_LINK /* no need for PL_force_link_funcs */ @@ -261,14 +304,13 @@ 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 @@ -327,7 +369,7 @@ extern char * win32_get_vendorlib(const char *pl, STRLEN *const len); extern void win32_delete_internal_host(void *h); #endif -extern char * staticlinkmodules[]; +extern const char * const staticlinkmodules[]; END_EXTERN_C