#include "XSUB.h"
#include <fcntl.h>
#include <sys/stat.h>
+#ifndef __GNUC__
+/* assert.h conflicts with #define of assert in perl.h */
#include <assert.h>
+#endif
#include <string.h>
#include <stdarg.h>
#include <float.h>
+#ifdef __GNUC__
+/* Mingw32 defaults to globing command line
+ * So we turn it off like this:
+ */
+int _CRT_glob = 0;
+#endif
+
#define EXECF_EXEC 1
#define EXECF_SPAWN 2
#define EXECF_SPAWN_NOWAIT 3
}
int
-setuid(uid_t uid)
+setuid(uid_t auid)
{
- return (uid == ROOT_UID ? 0 : -1);
+ return (auid == ROOT_UID ? 0 : -1);
}
int
-setgid(gid_t gid)
+setgid(gid_t agid)
{
- return (gid == ROOT_GID ? 0 : -1);
+ return (agid == ROOT_GID ? 0 : -1);
}
/*
* we have to roll our own.
*/
+#ifdef USE_THREADS
+#ifdef USE_DECLSPEC_THREAD
__declspec(thread) char strerror_buffer[512];
+#else
+#define strerror_buffer (thr->i.Wstrerror_buffer)
+#endif
+#else
+char strerror_buffer[512];
+#endif
DllExport char *
win32_strerror(int e)
DWORD source = 0;
if(e < 0 || e > sys_nerr) {
+ dTHR;
if(e < 0)
e = GetLastError();
}
DllExport int
-win32_fstat(int fd,struct stat *bufptr)
+win32_fstat(int fd,struct stat *sbufptr)
{
- return fstat(fd,bufptr);
+ return fstat(fd,sbufptr);
}
DllExport int
DllExport FILE*
win32_popen(const char *command, const char *mode)
{
-#ifdef __GNUC__
- return NULL;
-#else
return _popen(command, mode);
-#endif
}
DllExport int
win32_pclose(FILE *pf)
{
-#ifdef __GNUC__
- return fclose(pf);
-#else
return _pclose(pf);
-#endif
}
DllExport int
DllExport int
win32_flushall(void)
{
-#ifndef __GNUC__
return flushall();
-#endif
}
DllExport int
win32_fcloseall(void)
{
-#ifndef __GNUC__
return fcloseall();
-#endif
}
DllExport char*
#if !defined(_ALPHA_) && !defined(__GNUC__)
_control87(MCW_EM, MCW_EM);
#endif
+ MALLOC_INIT;
}
#ifdef USE_BINMODE_SCRIPTS
+