diff --git a/configure.ac b/configure.ac index 8714eac6..85a8ba52 100644 --- a/configure.ac +++ b/configure.ac @@ -123,6 +123,9 @@ AC_CHECK_HEADERS([time.h]) dnl Check for strings.h AC_CHECK_HEADERS([strings.h]) +dnl Check for fcntl.h +AC_CHECK_HEADERS([fcntl.h]) + dnl Check if sockaddr data struct includes a "sa_len" AC_CHECK_MEMBER([struct sockaddr.sa_len], [ AC_DEFINE([HAVE_SOCKADDR_LEN], [1], [Whether sockaddr struct has sa_len]) diff --git a/lib/Makefile.PS2_EE b/lib/Makefile.PS2_EE index 2eb155ef..338b262f 100644 --- a/lib/Makefile.PS2_EE +++ b/lib/Makefile.PS2_EE @@ -1,5 +1,5 @@ EE_CFLAGS = -DPS2_EE_PLATFORM -DHAVE_STDINT_H -DHAVE_STRING_H \ - -DHAVE_STDLIB_H -DHAVE_SYS_TYPES_H -DHAVE_UNISTD_H -DHAVE_SYS_STAT_H -DHAVE_TIME_H \ + -DHAVE_STDLIB_H -DHAVE_SYS_TYPES_H -DHAVE_UNISTD_H -DHAVE_SYS_STAT_H -DHAVE_TIME_H -DHAVE_FCNTL \ -D_U_=/**/ -I../include -I../include/smb2 EE_LIB = libsmb2.a diff --git a/lib/Makefile.PS3_PPU b/lib/Makefile.PS3_PPU index 17ff7788..553e1643 100644 --- a/lib/Makefile.PS3_PPU +++ b/lib/Makefile.PS3_PPU @@ -38,7 +38,7 @@ DATA := data LIBS := MACHDEP := -DPS3_PPU_PLATFORM -DHAVE_STDINT_H -DHAVE_STRING_H \ - -DHAVE_STDLIB_H -DHAVE_SYS_TYPES_H -DHAVE_UNISTD_H -DHAVE_TIME_H -D_U_=/**/ + -DHAVE_STDLIB_H -DHAVE_SYS_TYPES_H -DHAVE_UNISTD_H -DHAVE_TIME_H -DHAVE_FCNTL -D_U_=/**/ CFLAGS += -O2 -Wall -mcpu=cell $(MACHDEP) -fno-strict-aliasing $(INCLUDES) diff --git a/lib/libsmb2.c b/lib/libsmb2.c index 6cbf069b..19e9616b 100644 --- a/lib/libsmb2.c +++ b/lib/libsmb2.c @@ -56,8 +56,11 @@ #include #include -#ifndef PS2_IOP_PLATFORM +#ifdef HAVE_TIME_H #include +#endif + +#if !defined(PS2_IOP_PLATFORM) || defined(__GNUC__) || defined(HAVE_TIME_H) || defined(_MSC_VER) #include #endif diff --git a/lib/ntlmssp.c b/lib/ntlmssp.c index 31a32e51..39c20ce9 100644 --- a/lib/ntlmssp.c +++ b/lib/ntlmssp.c @@ -55,7 +55,7 @@ #include "portable-endian.h" #include -#ifndef PS2_IOP_PLATFORM +#ifdef HAVE_TIME_H #include #endif diff --git a/lib/pdu.c b/lib/pdu.c index 1329388d..6dd9e948 100644 --- a/lib/pdu.c +++ b/lib/pdu.c @@ -35,7 +35,7 @@ #include #endif -#ifndef PS2_IOP_PLATFORM +#ifdef HAVE_TIME_H #include #endif diff --git a/lib/socket.c b/lib/socket.c index 30494a56..d7525bec 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -72,7 +72,7 @@ #include "portable-endian.h" #include -#if !defined(PS2_IOP_PLATFORM) +#if !defined(PS2_IOP_PLATFORM) || defined(__GNUC__) || defined(HAVE_TIME_H) || defined(_MSC_VER) #include #endif diff --git a/lib/sync.c b/lib/sync.c index e864a074..7a34a00a 100644 --- a/lib/sync.c +++ b/lib/sync.c @@ -45,7 +45,7 @@ #include "compat.h" -#ifndef PS2_IOP_PLATFORM +#ifdef HAVE_TIME_H #include #endif