From 29dcfad804b48dd0c831c32b392f4e0c200f967d Mon Sep 17 00:00:00 2001 From: "mkaply%us.ibm.com" Date: Tue, 7 Mar 2000 21:00:06 +0000 Subject: [PATCH] # 25555 r= pavlov@netscape.com OS/2 changes for Mozilla - add #ifdef, change #ifdef --- dbm/include/mcom_db.h | 1 - dbm/src/h_bigkey.c | 2 +- dbm/src/h_page.c | 10 +++++----- dbm/src/hash.c | 17 +++++++++++++---- dbm/src/hash_buf.c | 2 +- dbm/src/mktemp.c | 8 +++++++- dbm/src/ndbm.c | 2 +- dbm/src/snprintf.c | 8 +++++--- 8 files changed, 33 insertions(+), 17 deletions(-) diff --git a/dbm/include/mcom_db.h b/dbm/include/mcom_db.h index 774b86c4e95..af4e0f9e26c 100644 --- a/dbm/include/mcom_db.h +++ b/dbm/include/mcom_db.h @@ -201,7 +201,6 @@ XP_END_PROTOS #if defined(XP_OS2) #include -#include XP_BEGIN_PROTOS int mkstemp(char *path); XP_END_PROTOS diff --git a/dbm/src/h_bigkey.c b/dbm/src/h_bigkey.c index 5dfa0cc4fb6..fe5d8f800b2 100644 --- a/dbm/src/h_bigkey.c +++ b/dbm/src/h_bigkey.c @@ -58,7 +58,7 @@ static char sccsid[] = "@(#)hash_bigkey.c 8.3 (Berkeley) 5/31/94"; * collect_data */ -#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) +#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2_VACPP) #include #endif diff --git a/dbm/src/h_page.c b/dbm/src/h_page.c index da31e9dbd1a..aa82b4ad43a 100644 --- a/dbm/src/h_page.c +++ b/dbm/src/h_page.c @@ -75,7 +75,7 @@ static char sccsid[] = "@(#)hash_page.c 8.7 (Berkeley) 8/16/94"; #include #include -#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) +#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2_VACPP) #include #endif @@ -1146,12 +1146,12 @@ __free_ovflpage(HTAB *hashp, BUFHEAD *obufp) static int open_temp(HTAB *hashp) { -#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) +#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2) sigset_t set, oset; #endif static char namestr[] = "_hashXXXXXX"; -#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) +#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2) /* Block signals; make sure file goes away at process exit. */ (void)sigfillset(&set); (void)sigprocmask(SIG_BLOCK, &set, &oset); @@ -1159,12 +1159,12 @@ open_temp(HTAB *hashp) if ((hashp->fp = mkstemp(namestr)) != -1) { (void)unlink(namestr); -#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) +#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2) (void)fcntl(hashp->fp, F_SETFD, 1); #endif } -#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) +#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2) (void)sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL); #endif return (hashp->fp != -1 ? 0 : -1); diff --git a/dbm/src/hash.c b/dbm/src/hash.c index 23b172ef823..be08567fca4 100644 --- a/dbm/src/hash.c +++ b/dbm/src/hash.c @@ -40,11 +40,15 @@ static char sccsid[] = "@(#)hash.c 8.9 (Berkeley) 6/16/94"; #include "watcomfx.h" -#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) +#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2_VACPP) #include #endif #if !defined(macintosh) +#ifdef XP_OS2_EMX +#include +#include "xp_mcom.h" /* For strdup. */ +#endif #include #endif @@ -58,10 +62,15 @@ static char sccsid[] = "@(#)hash.c 8.9 (Berkeley) 6/16/94"; #include #include -#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) +#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2_VACPP) #include #endif +#ifdef XP_OS2_VACPP +#include "types.h" +#define EPERM SOCEPERM +#endif + #ifdef DEBUG #include #endif @@ -183,7 +192,7 @@ __hash_open(const char *file, int flags, int mode, const HASHINFO *info, int dfl if (file) { -#if defined(_WIN32) || defined(_WINDOWS) || defined (macintosh) +#if defined(_WIN32) || defined(_WINDOWS) || defined (macintosh) || defined(XP_OS2_VACPP) if ((hashp->fp = DBFILE_OPEN(file, flags | O_BINARY, mode)) == -1) RETURN_ERROR(errno, error0); #else @@ -411,7 +420,7 @@ init_hash(HTAB *hashp, const char *file, HASHINFO *info) if (stat(file, &statbuf)) return (NULL); -#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(VMS) +#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(VMS) && !defined(XP_OS2) #ifdef __QNX__ hashp->BSIZE = statbuf.st_size; #else diff --git a/dbm/src/hash_buf.c b/dbm/src/hash_buf.c index 764a22d3e95..7bfe01a34dd 100644 --- a/dbm/src/hash_buf.c +++ b/dbm/src/hash_buf.c @@ -55,7 +55,7 @@ static char sccsid[] = "@(#)hash_buf.c 8.5 (Berkeley) 7/15/94"; * Internal * newbuf */ -#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) +#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2_VACPP) #include #endif diff --git a/dbm/src/mktemp.c b/dbm/src/mktemp.c index 51b669b1880..ab606e30fce 100644 --- a/dbm/src/mktemp.c +++ b/dbm/src/mktemp.c @@ -49,10 +49,16 @@ static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93"; #include #include "mcom_db.h" -#if !defined(_WINDOWS) +#if !defined(_WINDOWS) && !defined(XP_OS2_VACPP) #include #endif +#ifdef XP_OS2_VACPP +#define ENOTDIR EBADPOS +#include +#include +#endif + #ifdef _WINDOWS #include #include "winfile.h" diff --git a/dbm/src/ndbm.c b/dbm/src/ndbm.c index 99da62c0720..ca008de0c33 100644 --- a/dbm/src/ndbm.c +++ b/dbm/src/ndbm.c @@ -44,7 +44,7 @@ static char sccsid[] = "@(#)ndbm.c 8.4 (Berkeley) 7/21/94"; * This package provides a dbm compatible interface to the new hashing * package described in db(3). */ -#if !defined(_WIN32) && !defined(_WINDOWS) +#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(XP_OS2_VACPP) #include #endif diff --git a/dbm/src/snprintf.c b/dbm/src/snprintf.c index baf86cc3fc3..7a6b2005c53 100644 --- a/dbm/src/snprintf.c +++ b/dbm/src/snprintf.c @@ -4,6 +4,7 @@ #include #include #include + #if defined(_WINDOWS) || defined(SOLARIS) || defined(AIXV3) || defined(AIX) || defined(OSF1) || defined(NEC) || !defined(HAVE_SYS_CDEFS_H) #include "cdefs.h" #elif !defined(HPUX) && !defined(UNIXWARE) && !defined(SNI) @@ -14,14 +15,15 @@ #include -#ifdef __STDC__ +/* The OS/2 VAC compiler doesn't appear to define __STDC__ and won't let us define it either */ +#if defined(__STDC__) || defined(XP_OS2_VACPP) #include #else #include #endif int -#ifdef __STDC__ +#if defined(__STDC__) || defined(XP_OS2_VACPP) snprintf(char *str, size_t n, const char *fmt, ...) #else snprintf(str, n, fmt, va_alist) @@ -37,7 +39,7 @@ snprintf(str, n, fmt, va_alist) #else int rval; #endif -#ifdef __STDC__ +#if defined(__STDC__) || defined(XP_OS2_VACPP) va_start(ap, fmt); #else va_start(ap);