Windows global stuff:
[krb5.git] / src / include / fake-stdlib.h
index 80df15a452809b1b879c8dabfd78915de609d77f..5f021a22803f86ff4cc654afd471b21f8581901c 100644 (file)
@@ -1,5 +1,4 @@
-#ifdef __STDC__
-# define       P(s) s
+#if defined(__STDC__) || defined(_WINDOWS)
 #else
 # define P(s) ()
 #endif
@@ -81,7 +80,9 @@ int close P((int ));
 int dup P((int ));
 int dup2 P((int , int ));
 int execve P((char *, char * [], char * []));
+#ifndef __GNUC__
 int _exit P((int ));
+#endif
 int fchmod P((int , int ));
 int fchown P((int , int , int ));
 int fcntl P((int , int , int ));
@@ -138,12 +139,7 @@ long atol P((char *));
 int bcmp P((char *, char *, int ));
 int bcopy P((const char *, char *, int ));
 int bzero P((char *, int ));
-#ifdef __GNUC__
-#include <stddef.h>
-void *calloc P((size_t, size_t));
-#else
-char *calloc P((unsigned , unsigned ));
-#endif
+void *calloc P((unsigned long, unsigned long));
 void closelog P((void ));
 int creat P((char *, int ));
 char *crypt P((char *, char *));
@@ -164,7 +160,9 @@ int execlp P((char *, char *, ...));
 int execv P((char *, char * []));
 int execvp P((char *, char * []));
 int exect P((char *, char * [], char * []));
+#ifndef __GNUC__
 int exit P((int ));
+#endif
 char *fcvt P((double , int , int *, int *));
 int ffs P((int ));
 #ifdef __GNUC__
@@ -202,16 +200,18 @@ char *initstate P((unsigned , char *, int ));
 int isatty P((int ));
 double ldexp P((double , int ));
 int longjmperror P((void ));
-#ifdef __STDC__
+#if defined(__STDC__) || defined(_WINDOWS)
 void *malloc P((size_t ));
 #else
 char *malloc P((unsigned ));
 #endif
 char *memccpy P((char *, char *, int , int ));
 char *memchr P((char *, int , int ));
+#ifndef __GNUC__
 int memcmp P((char *, char *, int ));
 char *memcpy P((char *, const char *, int ));
 char *memset P((char *, int , int ));
+#endif
 char *mktemp P((char *));
 int mkstemp P((char *));
 double modf P((double , double *));
@@ -260,10 +260,6 @@ int setusershell P((void ));
 int siginterrupt P((int , int ));
 int sleep P((unsigned ));
 int srand P((int ));
-size_t strlen P((const char *));
-char *strncat P((char *, const char *, int ));
-int strncmp P((const char *, const char *, int ));
-char *strncpy P((char *, const char *, int ));
 int swab P((char *, char *, int ));
 void syslog P((int , const char *, ...));
 int system P((char *));
@@ -278,7 +274,9 @@ int usleep P((unsigned ));
 int utime P((char *, time_t *));
 char *valloc P((unsigned ));
 int vlimit P((int , int ));
+#ifndef __GNUC__
 void abort P((void));
+#endif
 
 #endif /* VAX */
 
@@ -467,7 +465,7 @@ struct ttyent *getttyent P((void ));
 struct ttyent *getttynam P((const char * ));
 unsigned long inet_network P((const char * ));
 int initgroups P((char * , int  ));
-#ifdef __STDC__
+#if defined(__STDC__) || defined(_WINDOWS)
 void *malloc P((unsigned ));
 #else
 char *malloc P((unsigned ));
@@ -515,7 +513,9 @@ int siginterrupt P((int  , int  ));
 unsigned sleep P((unsigned  ));
 int strcmp P((const char * , const char * ));
 char *strcpy P((char * , const char * ));
+#ifndef hpux
 int strlen P((const char * ));
+#endif
 char *strncat P((char * , const char * , int  ));
 int strncmp P((const char * , const char * , int  ));
 char *strncpy P((char * , const char * , int  ));
@@ -692,7 +692,7 @@ extern int    atoi P((const char *));
 
 #ifndef abs
 extern int abs(int);
-#ifdef __HIGHC__
+#if 0 /* used to be __HIGHC__; that interferes with jfc's c89 stdlib.h */
 #define        abs(x)  _abs(x)
 #endif
 #endif