Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
28f3168f
Commit
28f3168f
authored
Mar 23, 2004
by
deuce
Browse files
Remove pendantic warnings.
parent
22a4ec36
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
8 deletions
+51
-8
src/xpdev/Common.gmake
src/xpdev/Common.gmake
+10
-3
src/xpdev/dirwrap.c
src/xpdev/dirwrap.c
+15
-0
src/xpdev/filewrap.c
src/xpdev/filewrap.c
+3
-3
src/xpdev/filewrap.h
src/xpdev/filewrap.h
+5
-0
src/xpdev/genwrap.h
src/xpdev/genwrap.h
+2
-1
src/xpdev/sockwrap.h
src/xpdev/sockwrap.h
+1
-0
src/xpdev/xpsem.h
src/xpdev/xpsem.h
+15
-1
No files found.
src/xpdev/Common.gmake
View file @
28f3168f
...
...
@@ -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
...
...
src/xpdev/dirwrap.c
View file @
28f3168f
...
...
@@ -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
"
);
...
...
src/xpdev/filewrap.c
View file @
28f3168f
...
...
@@ -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
#if
n
def
F_SANEWRLCKNO
#if
!
def
ined(
F_SANEWRLCKNO
) && !defined(__QNX__) && !defined(__solaris__)
/* use flock (doesn't work over NFS) */
if
(
share
==
SH_DENYRW
)
flock_op
|=
LOCK_EX
;
...
...
src/xpdev/filewrap.h
View file @
28f3168f
...
...
@@ -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>
...
...
src/xpdev/genwrap.h
View file @
28f3168f
...
...
@@ -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
...
...
src/xpdev/sockwrap.h
View file @
28f3168f
...
...
@@ -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
...
...
src/xpdev/xpsem.h
View file @
28f3168f
...
...
@@ -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
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment