diff options
author | wtc%netscape.com <devnull@localhost> | 2001-10-19 05:45:51 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 2001-10-19 05:45:51 +0000 |
commit | ffbcac5218d1ed487d2fdd2de2ecf21f366c9a13 (patch) | |
tree | e7d68d58136e928c2c4a5a97a534c3dc289a2c74 /dbm | |
parent | d0e106ec5715625060332a6df46294d519de3f4c (diff) | |
download | nss-hg-ffbcac5218d1ed487d2fdd2de2ecf21f366c9a13.tar.gz |
Bugzilla bug 105173: in mcom_db.h, put the tests for HAVE_XXX_H inside
#ifdef __DBINTERFACE_PRIVATE so that users of this exported header don't
have to define these HAVE_XXX_H macros. Define __DBINTERFACE_PRIVATE
in dbm/macbuild/DBMConfig.h and dbm/src/Makefile.win. r=brendan@mozilla.org
Diffstat (limited to 'dbm')
-rw-r--r-- | dbm/include/mcom_db.h | 147 | ||||
-rw-r--r-- | dbm/macbuild/DBMConfig.h | 2 | ||||
-rw-r--r-- | dbm/src/Makefile.win | 2 |
3 files changed, 69 insertions, 82 deletions
diff --git a/dbm/include/mcom_db.h b/dbm/include/mcom_db.h index 430341ec2..ae403df28 100644 --- a/dbm/include/mcom_db.h +++ b/dbm/include/mcom_db.h @@ -74,15 +74,22 @@ #ifndef _DB_H_ #define _DB_H_ +#ifndef macintosh +#include <sys/types.h> +#endif +#include "prtypes.h" + +#include <limits.h> + +#ifdef __DBINTERFACE_PRIVATE + #ifdef HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #else #include "cdefs.h" #endif -#include "prtypes.h" #ifdef HAVE_SYS_BYTEORDER_H -#include <sys/types.h> #include <sys/byteorder.h> #endif @@ -99,14 +106,14 @@ #define BYTE_ORDER BIG_ENDIAN #define BIG_ENDIAN 4321 #define LITTLE_ENDIAN 1234 /* LSB first: i386, vax, all NT risc */ -#define __BIT_TYPES_DEFINED__ #endif #ifdef __sun #define BIG_ENDIAN 4321 #define LITTLE_ENDIAN 1234 /* LSB first: i386, vax, all NT risc */ -#ifdef HAVE_COMPAT_H +#ifndef SVR4 +/* compat.h is only in 4.1.3 machines. - dp */ #include <compat.h> #endif @@ -136,6 +143,32 @@ #endif /* !BYTE_ORDER */ #endif /* __sun */ +#if defined(__hpux) || defined(__hppa) +#define BYTE_ORDER BIG_ENDIAN +#define BIG_ENDIAN 4321 +#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax, all NT risc */ +#endif + +#if defined(AIXV3) || defined(AIX) +/* BYTE_ORDER, LITTLE_ENDIAN, BIG_ENDIAN are all defined here */ +#include <sys/machine.h> +#endif + +/* Digital Unix */ +#ifdef __osf__ +#include <machine/endian.h> +#endif + +#ifdef __alpha +#ifndef WIN32 +#else +/* Alpha NT */ +#define BYTE_ORDER LITTLE_ENDIAN +#define BIG_ENDIAN 4321 +#define LITTLE_ENDIAN 1234 +#endif +#endif + #ifdef NCR #include <sys/endian.h> #endif @@ -146,11 +179,6 @@ #define BYTE_ORDER LITTLE_ENDIAN #endif -#ifdef SCO -#include <sys/bitypes.h> -#define MAXPATHLEN 1024 -#endif - #ifdef SNI /* #include <sys/hetero.h> */ #define BYTE_ORDER BIG_ENDIAN @@ -158,6 +186,28 @@ #define LITTLE_ENDIAN 1234 #endif +#if defined(_WINDOWS) || defined(XP_OS2) +#ifdef BYTE_ORDER +#undef BYTE_ORDER +#endif + +#define BYTE_ORDER LITTLE_ENDIAN +#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax, all NT risc */ +#define BIG_ENDIAN 4321 +#endif + +#ifdef macintosh +#define BIG_ENDIAN 4321 +#define LITTLE_ENDIAN 1234 +#define BYTE_ORDER BIG_ENDIAN +#endif + +#endif /* __DBINTERFACE_PRIVATE */ + +#ifdef SCO +#define MAXPATHLEN 1024 +#endif + #ifdef macintosh #include <unix.h> #else @@ -167,7 +217,6 @@ #if defined(_WINDOWS) || defined(XP_OS2) #include <stdio.h> #include <io.h> -#include <limits.h> #ifndef XP_OS2 #define MAXPATHLEN 1024 @@ -186,28 +235,11 @@ #ifndef O_ACCMODE /* POSIX 1003.1 access mode mask. */ #define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) #endif - -#ifdef BYTE_ORDER -#undef BYTE_ORDER #endif -#define BYTE_ORDER LITTLE_ENDIAN -#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax, all NT risc */ -#define BIG_ENDIAN 4321 -#endif - -#if defined(_WINDOWS) && !defined(_WIN32) -/* 16 bit windows defines */ -#define MAX_PAGE_NUMBER 0xffffffff /* >= # of pages in a file */ -#endif - - #ifdef macintosh #include <stdio.h> #include "xp_mcom.h" -#define BIG_ENDIAN 4321 -#define LITTLE_ENDIAN 1234 -#define BYTE_ORDER BIG_ENDIAN #define O_ACCMODE 3 /* Mask for file access modes */ #define EFTYPE 2000 XP_BEGIN_PROTOS @@ -215,34 +247,20 @@ int mkstemp(const char *path); XP_END_PROTOS #endif /* MACINTOSH */ -#if defined(XP_OS2) -/* #include <xp_mcom.h> */ -/* XP_BEGIN_PROTOS */ -/* int mkstemp(char *path); */ -/* XP_END_PROTOS */ -#endif - -#ifndef macintosh -#include <sys/types.h> -#endif - #if !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2) #include <sys/stat.h> #include <errno.h> #endif -#ifndef _WINDOWS /* included above to prevent spurious warnings chouck 12-Sep-95 */ -#include <limits.h> +/* define EFTYPE since most don't */ +#ifndef EFTYPE +#define EFTYPE EINVAL /* POSIX 1003.1 format errno. */ #endif #define RET_ERROR -1 /* Return values. */ #define RET_SUCCESS 0 #define RET_SPECIAL 1 -#if defined(__386BSD__) || defined(SCO) -#define __BIT_TYPES_DEFINED__ -#endif - #define MAX_PAGE_NUMBER 0xffffffff /* >= # of pages in a file */ #ifndef __sgi @@ -254,11 +272,6 @@ typedef uint16 indx_t; #define MAX_REC_NUMBER 0xffffffff /* >= # of records in a tree */ typedef uint32 recno_t; -/* define EFTYPE since most don't */ -#ifndef EFTYPE -#define EFTYPE EINVAL /* POSIX 1003.1 format errno. */ -#endif - /* Key/data structure -- a Data-Base Thang. */ typedef struct { void *data; /* data */ @@ -364,7 +377,7 @@ typedef struct { char *bfname; /* btree file name */ } RECNOINFO; -/* #ifdef __DBINTERFACE_PRIVATE */ +#ifdef __DBINTERFACE_PRIVATE /* * Little endian <==> big endian 32-bit swap macros. * M_32_SWAP swap a memory location @@ -412,9 +425,9 @@ typedef struct { ((char *)&(b))[0] = ((char *)&(a))[1]; \ ((char *)&(b))[1] = ((char *)&(a))[0]; \ } -/* #endif */ +#endif -__BEGIN_DECLS +PR_BEGIN_EXTERN_C #if defined(__WATCOMC__) || defined(__WATCOM_CPLUSPLUS__) extern DB * #else @@ -427,39 +440,13 @@ dbopen (const char *, int, int, DBTYPE, const void *); */ void dbSetOrClearDBLock(DBLockFlagEnum type); -/* #ifdef __DBINTERFACE_PRIVATE */ +#ifdef __DBINTERFACE_PRIVATE DB *__bt_open (const char *, int, int, const BTREEINFO *, int); DB *__hash_open (const char *, int, int, const HASHINFO *, int); DB *__rec_open (const char *, int, int, const RECNOINFO *, int); void __dbpanic (DB *dbp); -/* #endif */ - -__END_DECLS - -#if defined(__hpux) || defined(__hppa) -#define BYTE_ORDER BIG_ENDIAN -#define BIG_ENDIAN 4321 -#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax, all NT risc */ -#endif - -#if defined(AIXV3) || defined(AIX) -/* BYTE_ORDER, LITTLE_ENDIAN, BIG_ENDIAN are all defined here */ -#include <sys/machine.h> -#endif - -/* Digital Unix */ -#ifdef __osf__ -#include <machine/endian.h> #endif -#ifdef __alpha -#ifndef WIN32 -#else -/* Alpha NT */ -#define BYTE_ORDER LITTLE_ENDIAN -#define BIG_ENDIAN 4321 -#define LITTLE_ENDIAN 1234 -#endif -#endif +PR_END_EXTERN_C #endif /* !_DB_H_ */ diff --git a/dbm/macbuild/DBMConfig.h b/dbm/macbuild/DBMConfig.h index 6493d254f..e7ec911c6 100644 --- a/dbm/macbuild/DBMConfig.h +++ b/dbm/macbuild/DBMConfig.h @@ -20,4 +20,4 @@ * Contributor(s): */ -/* Nothing to do here. If you need DBM-specific defines, put them here */ +#define __DBINTERFACE_PRIVATE 1 diff --git a/dbm/src/Makefile.win b/dbm/src/Makefile.win index 1d49e5f91..060a8c48b 100644 --- a/dbm/src/Makefile.win +++ b/dbm/src/Makefile.win @@ -88,7 +88,7 @@ LINCS = -I..\include #//------------------------------------------------------------------------ include <$(DEPTH)/config/rules.mak> -CFLAGS = $(CFLAGS) -DMOZILLA_CLIENT +CFLAGS = $(CFLAGS) -DMOZILLA_CLIENT -D__DBINTERFACE_PRIVATE install:: $(LIBRARY) $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib |