summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/ext/SDBM_File/sdbm/sdbm.h
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/ext/SDBM_File/sdbm/sdbm.h')
-rw-r--r--gnu/usr.bin/perl/ext/SDBM_File/sdbm/sdbm.h94
1 files changed, 62 insertions, 32 deletions
diff --git a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/sdbm.h b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/sdbm.h
index 4d6c8448902..fdd9165145c 100644
--- a/gnu/usr.bin/perl/ext/SDBM_File/sdbm/sdbm.h
+++ b/gnu/usr.bin/perl/ext/SDBM_File/sdbm/sdbm.h
@@ -79,15 +79,15 @@ extern DBM *sdbm_prep proto((char *, char *, int, int));
extern long sdbm_hash proto((char *, int));
#ifndef SDBM_ONLY
-#define dbm_open sdbm_open;
-#define dbm_close sdbm_close;
-#define dbm_fetch sdbm_fetch;
-#define dbm_store sdbm_store;
-#define dbm_delete sdbm_delete;
-#define dbm_firstkey sdbm_firstkey;
-#define dbm_nextkey sdbm_nextkey;
-#define dbm_error sdbm_error;
-#define dbm_clearerr sdbm_clearerr;
+#define dbm_open sdbm_open
+#define dbm_close sdbm_close
+#define dbm_fetch sdbm_fetch
+#define dbm_store sdbm_store
+#define dbm_delete sdbm_delete
+#define dbm_firstkey sdbm_firstkey
+#define dbm_nextkey sdbm_nextkey
+#define dbm_error sdbm_error
+#define dbm_clearerr sdbm_clearerr
#endif
/* Most of the following is stolen from perl.h. */
@@ -108,17 +108,6 @@ extern long sdbm_hash proto((char *, int));
# endif
#endif
-#ifdef MYMALLOC
-# ifdef HIDEMYMALLOC
-# define malloc Mymalloc
-# define realloc Myremalloc
-# define free Myfree
-# endif
-# define safemalloc malloc
-# define saferealloc realloc
-# define safefree free
-#endif
-
#if defined(__STDC__) || defined(_AIX) || defined(__stdc__) || defined(__cplusplus)
# define STANDARD_C 1
#endif
@@ -131,7 +120,7 @@ extern long sdbm_hash proto((char *, int));
#include <unistd.h>
#endif
-#ifndef MSDOS
+#if !defined(MSDOS) && !defined(WIN32)
# ifdef PARAM_NEEDS_TYPES
# include <sys/types.h>
# endif
@@ -161,6 +150,31 @@ extern long sdbm_hash proto((char *, int));
#define MEM_SIZE Size_t
+/* This comes after <stdlib.h> so we don't try to change the standard
+ * library prototypes; we'll use our own instead. */
+
+#if defined(MYMALLOC) && (defined(HIDEMYMALLOC) || defined(EMBEDMYMALLOC))
+
+# ifdef HIDEMYMALLOC
+# define malloc Mymalloc
+# define calloc Mycalloc
+# define realloc Myremalloc
+# define free Myfree
+# endif
+# ifdef EMBEDMYMALLOC
+# define malloc Perl_malloc
+# define calloc Perl_calloc
+# define realloc Perl_realloc
+# define free Perl_free
+# endif
+
+ Malloc_t malloc proto((MEM_SIZE nbytes));
+ Malloc_t calloc proto((MEM_SIZE elements, MEM_SIZE size));
+ Malloc_t realloc proto((Malloc_t where, MEM_SIZE nbytes));
+ Free_t free proto((Malloc_t where));
+
+#endif /* MYMALLOC && (HIDEMYMALLOC || EMBEDMYMALLOC) */
+
#ifdef I_STRING
#include <string.h>
#else
@@ -171,14 +185,10 @@ extern long sdbm_hash proto((char *, int));
#include <memory.h>
#endif
-#if defined(mips) && defined(ultrix) && !defined(__STDC__)
-# undef HAS_MEMCMP
-#endif
-
#ifdef HAS_MEMCPY
# if !defined(STANDARD_C) && !defined(I_STRING) && !defined(I_MEMORY)
# ifndef memcpy
- extern char * memcpy _((char*, char*, int));
+ extern char * memcpy proto((char*, char*, int));
# endif
# endif
#else
@@ -194,7 +204,7 @@ extern long sdbm_hash proto((char *, int));
#ifdef HAS_MEMSET
# if !defined(STANDARD_C) && !defined(I_STRING) && !defined(I_MEMORY)
# ifndef memset
- extern char *memset _((char*, int, int));
+ extern char *memset proto((char*, int, int));
# endif
# endif
# define memzero(d,l) memset(d,0,l)
@@ -208,24 +218,44 @@ extern long sdbm_hash proto((char *, int));
# endif
#endif /* HAS_MEMSET */
-#ifdef HAS_MEMCMP
+#if defined(mips) && defined(ultrix) && !defined(__STDC__)
+# undef HAS_MEMCMP
+#endif
+
+#if defined(HAS_MEMCMP) && defined(HAS_SANE_MEMCMP)
# if !defined(STANDARD_C) && !defined(I_STRING) && !defined(I_MEMORY)
# ifndef memcmp
- extern int memcmp _((char*, char*, int));
+ extern int memcmp proto((char*, char*, int));
# endif
# endif
+# ifdef BUGGY_MSC
+ # pragma function(memcmp)
+# endif
#else
# ifndef memcmp
-# define memcmp my_memcmp
+# /* maybe we should have included the full embedding header... */
+# ifdef NO_EMBED
+# define memcmp my_memcmp
+# else
+# define memcmp Perl_my_memcmp
+# endif
+ extern int memcmp proto((char*, char*, int));
# endif
#endif /* HAS_MEMCMP */
-/* we prefer bcmp slightly for comparisons that don't care about ordering */
#ifndef HAS_BCMP
# ifndef bcmp
# define bcmp(s1,s2,l) memcmp(s1,s2,l)
# endif
-#endif /* HAS_BCMP */
+#endif /* !HAS_BCMP */
+
+#ifdef HAS_MEMCMP
+# define memNE(s1,s2,l) (memcmp(s1,s2,l))
+# define memEQ(s1,s2,l) (!memcmp(s1,s2,l))
+#else
+# define memNE(s1,s2,l) (bcmp(s1,s2,l))
+# define memEQ(s1,s2,l) (!bcmp(s1,s2,l))
+#endif
#ifdef I_NETINET_IN
# include <netinet/in.h>