summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanda <devnull@localhost>1998-04-20 03:07:39 +0000
committerdanda <devnull@localhost>1998-04-20 03:07:39 +0000
commitdb68da45c1aaee761ba20ec8b6e344d22d890f0b (patch)
tree3f395ddfacd2c7479dfcb001515accd44690c357
parent655b5d5dfb17d4e80742dff6a3660ff0eb5b7b41 (diff)
downloadnss-hg-db68da45c1aaee761ba20ec8b6e344d22d890f0b.tar.gz
Fixing OS/2 build breaks
-rw-r--r--dbm/include/mcom_db.h2
-rw-r--r--dbm/src/h_bigkey.c2
-rw-r--r--dbm/src/h_page.c10
-rw-r--r--dbm/src/hash.c12
-rw-r--r--dbm/src/hash_buf.c2
-rw-r--r--dbm/src/mktemp.c8
-rw-r--r--dbm/src/ndbm.c2
-rw-r--r--dbm/src/snprintf.c9
8 files changed, 29 insertions, 18 deletions
diff --git a/dbm/include/mcom_db.h b/dbm/include/mcom_db.h
index 78fa11d8e..60a7dd4de 100644
--- a/dbm/include/mcom_db.h
+++ b/dbm/include/mcom_db.h
@@ -124,7 +124,7 @@
#include <fcntl.h>
#endif
-#ifdef _WINDOWS
+#if defined(_WINDOWS) || defined(XP_OS2)
#include <stdio.h>
#include <io.h>
#include <limits.h>
diff --git a/dbm/src/h_bigkey.c b/dbm/src/h_bigkey.c
index c1f063a49..d14c02244 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 <sys/param.h>
#endif
diff --git a/dbm/src/h_page.c b/dbm/src/h_page.c
index afb9897dc..6bcbf2dc2 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 <stdlib.h>
#include <string.h>
-#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh)
+#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2_VACPP)
#include <unistd.h>
#endif
@@ -1149,12 +1149,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);
@@ -1162,12 +1162,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 c8e9a234f..294c975b7 100644
--- a/dbm/src/hash.c
+++ b/dbm/src/hash.c
@@ -40,7 +40,7 @@ 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 <sys/param.h>
#endif
@@ -58,10 +58,14 @@ static char sccsid[] = "@(#)hash.c 8.9 (Berkeley) 6/16/94";
#include <stdlib.h>
#include <string.h>
-#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh)
+#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2_VACPP)
#include <unistd.h>
#endif
+#ifdef XP_OS2_VACPP
+#define EPERM SOCEPERM
+#endif
+
#ifdef DEBUG
#include <assert.h>
#endif
@@ -189,7 +193,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
@@ -417,7 +421,7 @@ init_hash(HTAB *hashp, const char *file, HASHINFO *info)
if (stat(file, &statbuf))
return (NULL);
-#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh)
+#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2)
hashp->BSIZE = statbuf.st_blksize;
/* new code added by Lou to reduce block
diff --git a/dbm/src/hash_buf.c b/dbm/src/hash_buf.c
index a2c428007..d9bd7ba44 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 <sys/param.h>
#endif
diff --git a/dbm/src/mktemp.c b/dbm/src/mktemp.c
index 51b669b18..ab606e30f 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 <ctype.h>
#include "mcom_db.h"
-#if !defined(_WINDOWS)
+#if !defined(_WINDOWS) && !defined(XP_OS2_VACPP)
#include <unistd.h>
#endif
+#ifdef XP_OS2_VACPP
+#define ENOTDIR EBADPOS
+#include <process.h>
+#include <dirent.h>
+#endif
+
#ifdef _WINDOWS
#include <process.h>
#include "winfile.h"
diff --git a/dbm/src/ndbm.c b/dbm/src/ndbm.c
index 99da62c07..ca008de0c 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 <sys/param.h>
#endif
diff --git a/dbm/src/snprintf.c b/dbm/src/snprintf.c
index 1778df19a..f7865116c 100644
--- a/dbm/src/snprintf.c
+++ b/dbm/src/snprintf.c
@@ -2,7 +2,7 @@
#include <sys/types.h>
#include <stddef.h>
#include <stdio.h>
-#if defined(_WINDOWS) || defined(SOLARIS) || defined(AIXV3) || defined(AIX) || defined(OSF1) || defined(NEC)
+#if defined(_WINDOWS) || defined(SOLARIS) || defined(AIXV3) || defined(AIX) || defined(OSF1) || defined(NEC) || defined(XP_OS2_VACPP)
#include "cdefs.h"
#elif !defined(HPUX) && !defined(UNIXWARE) && !defined(SNI)
#include <sys/cdefs.h>
@@ -12,14 +12,15 @@
#include <ncompat.h>
-#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 <stdarg.h>
#else
#include <varargs.h>
#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)
@@ -35,7 +36,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);