Commit 28f3168f authored by deuce's avatar deuce
Browse files

Remove pendantic warnings.

parent 22a4ec36
......@@ -14,7 +14,7 @@ ifndef VERBOSE
endif
# Compiler-specific options
CFLAGS += -MMD -Wall
CFLAGS += -MMD
CCPRE ?= gcc
ifdef BUILD_DEPENDS
CC = $(XPDEV)../build/mkdep -a
......@@ -54,7 +54,11 @@ else
ifeq ($(os),openbsd)
DELETE := rm -f
else
DELETE = rm -fv
ifeq ($(os),sunos)
DELETE := rm -f
else
DELETE = rm -fv
endif
endif
endif
......@@ -112,8 +116,11 @@ else
PTHREAD_LDFLAGS += -lpthread
XP_SEM := 1
else
ifeq ($(os),solaris) # Solaris
ifeq ($(os),sunos) # Solaris
XP_SEM := 1
PTHREAD_CFLAGS += -D_POSIX_PTHREAD_SEMANTICS
PTHREAD_CFLAGS += -DUSE_XP_SEMAPHORES
PTHREAD_LDFLAGS += -lpthread
else # Linux / Other UNIX
XP_SEM := 1
PTHREAD_CFLAGS += -DUSE_XP_SEMAPHORES
......
......@@ -62,6 +62,10 @@
#include <sys/vfs.h> /* statfs() */
#endif
#if defined(__solaris__)
#include <sys/statvfs.h>
#endif
#endif /* __unix__ */
#if defined(__WATCOMC__)
......@@ -719,6 +723,17 @@ ulong DLLCALL getfreediskspace(const char* path, ulong unit)
fs.f_bavail/=unit;
return fs.f_bsize * fs.f_bavail;
#elif defined(__solaris__)
struct statvfs fs;
if (statvfs(path, &fs) < 0)
return 0;
if(unit>1)
fs.f_bavail/=unit;
return fs.f_bsize * fs.f_bavail;
#else
fprintf(stderr,"\n*** !Missing getfreediskspace implementation ***\n");
......
......@@ -108,7 +108,7 @@ int DLLCALL lock(int fd, long pos, long len)
return(-1);
#endif
#if !defined(F_SANEWRLCKNO) && !defined(__QNX__)
#if !defined(F_SANEWRLCKNO) && !defined(__QNX__) && !defined(__solaris__)
/* use flock (doesn't work over NFS) */
if(flock(fd,LOCK_EX|LOCK_NB)!=0 && errno != EOPNOTSUPP)
return(-1);
......@@ -135,7 +135,7 @@ int DLLCALL unlock(int fd, long pos, long len)
return(-1);
#endif
#if !defined(F_SANEUNLCK) && !defined(__QNX__)
#if !defined(F_SANEUNLCK) && !defined(__QNX__) && !defined(__solaris__)
/* use flock (doesn't work over NFS) */
if(flock(fd,LOCK_UN|LOCK_NB)!=0 && errno != EOPNOTSUPP)
return(-1);
......@@ -182,7 +182,7 @@ int DLLCALL sopen(const char *fn, int access, int share, ...)
}
#endif
#ifndef F_SANEWRLCKNO
#if !defined(F_SANEWRLCKNO) && !defined(__QNX__) && !defined(__solaris__)
/* use flock (doesn't work over NFS) */
if(share==SH_DENYRW)
flock_op|=LOCK_EX;
......
......@@ -70,6 +70,11 @@
#elif defined(__unix__)
#include <fcntl.h>
#ifdef __solaris__
#define LOCK_NB 1
#define LOCK_SH 2
#define LOCK_EX 4
#endif
#ifdef __QNX__
#include <share.h>
......
......@@ -263,7 +263,8 @@ extern "C" {
#endif
#if defined(__solaris__)
#define CTIME_R(x,y) ctime_r(x,y,sizeof y)
#define CTIME_R(x,y) ctime_r(x,y)
/* #define CTIME_R(x,y) ctime_r(x,y,sizeof y) */
#else
#define CTIME_R(x,y) ctime_r(x,y)
#endif
......
......@@ -68,6 +68,7 @@
#include <unistd.h> /* close */
#if defined(__solaris__)
#include <sys/filio.h> /* FIONBIO */
#define INADDR_NONE -1L
#else
#include <sys/ioctl.h> /* FIONBIO */
#endif
......
......@@ -54,8 +54,22 @@ typedef struct xp_sem *xp_sem_t;
#define SEM_FAILED ((xp_sem_t *)0)
#define SEM_VALUE_MAX UINT_MAX
#if defined(__cplusplus)
#define __BEGIN_DECLS extern "C" {
#define __END_DECLS }
#else
#define __BEGIN_DECLS
#define __END_DECLS
#endif
#define __P(protos) () /* traditional C preprocessor */
/* full-blown ANSI C */
/* #define __P(protos) protos */
#ifdef __solaris__
typedef unsigned int u_int32_t;
#endif
#ifndef KERNEL
#include <sys/cdefs.h>
__BEGIN_DECLS
int xp_sem_init __P((xp_sem_t *, int, unsigned int));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment