From 96cfbc7353194a3782c95c05c568a9923b43babc Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Tue, 29 Apr 2003 23:25:48 +0000 Subject: [PATCH] Change lock/unlock prototypes to match Borland's and QNX's (long vs int len). Removed excessive #ifdef __QNX__ blocks. --- src/xpdev/filewrap.c | 12 ++---------- src/xpdev/filewrap.h | 9 +++------ 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/xpdev/filewrap.c b/src/xpdev/filewrap.c index fd34ebf6ab..33a4c602e6 100644 --- a/src/xpdev/filewrap.c +++ b/src/xpdev/filewrap.c @@ -83,11 +83,7 @@ long DLLCALL filelength(int fd) } /* Sets a lock on a portion of a file */ -#ifdef __QNX__ int DLLCALL lock(int fd, long pos, long len) -#else /* Not QNX */ -int DLLCALL lock(int fd, long pos, int len) -#endif { #if defined(F_SANERDLCKNO) || !defined(BSD) struct flock alock; @@ -122,11 +118,7 @@ int DLLCALL lock(int fd, long pos, int len) } /* Removes a lock from a file record */ -#ifdef __QNX__ int DLLCALL unlock(int fd, long pos, long len) -#else -int DLLCALL unlock(int fd, long pos, int len) -#endif { #if defined(F_SANEUNLCK) || !defined(BSD) @@ -219,7 +211,7 @@ int DLLCALL sopen(const char *fn, int access, int share, ...) #define LK_UNLCK LK_UNLOCK #endif -int DLLCALL lock(int file, long offset, int size) +int DLLCALL lock(int file, long offset, long size) { int i; long pos; @@ -233,7 +225,7 @@ int DLLCALL lock(int file, long offset, int size) return(i); } -int DLLCALL unlock(int file, long offset, int size) +int DLLCALL unlock(int file, long offset, long size) { int i; long pos; diff --git a/src/xpdev/filewrap.h b/src/xpdev/filewrap.h index 61ec9087aa..a13a170b08 100644 --- a/src/xpdev/filewrap.h +++ b/src/xpdev/filewrap.h @@ -72,7 +72,6 @@ #ifdef __QNX__ #include <share.h> #define L_SET SEEK_SET - #define sopen(x,y,z) qnx_sopen(x,y,z) /* Stupid macro trick */ #else #define O_TEXT 0 /* all files in binary mode on Unix */ #define O_BINARY 0 /* all files in binary mode on Unix */ @@ -113,15 +112,13 @@ extern "C" { #endif -#if !defined(__BORLANDC__) && !defined(__QNX__) - DLLEXPORT int DLLCALL lock(int fd, long pos, int len); - DLLEXPORT int DLLCALL unlock(int fd, long pos, int len); +#if !defined(__BORLANDC__) + DLLEXPORT int DLLCALL lock(int fd, long pos, long len); + DLLEXPORT int DLLCALL unlock(int fd, long pos, long len); #endif #if !defined(__BORLANDC__) && defined(__unix__) -#if !defined(__QNX__) DLLEXPORT int DLLCALL sopen(const char* fn, int access, int share, ...); -#endif DLLEXPORT long DLLCALL filelength(int fd); #endif -- GitLab