]> granicus.if.org Git - php/commitdiff
* Rename php_compat.[ch] to flock_compat.[ch] and move it to ext/standard
authorZeev Suraski <zeev@php.net>
Wed, 21 Apr 1999 19:01:38 +0000 (19:01 +0000)
committerZeev Suraski <zeev@php.net>
Wed, 21 Apr 1999 19:01:38 +0000 (19:01 +0000)
* Fix Win32 compilation

Makefile.in
ext/standard/Makefile.am
ext/standard/file.c
ext/standard/flock_compat.c [moved from php_compat.c with 98% similarity]
ext/standard/flock_compat.h [new file with mode: 0644]
ext/standard/string.c
main/config.w32.h
main/php.h
main/php_compat.h [deleted file]
php4.dsp

index 90185c5956647ccae8fc656dc5830ed32f7a359d..876fc4d446440a88be74cf2b56610744fcc81d2e 100644 (file)
@@ -62,11 +62,11 @@ WARNING_LEVEL = @WARNING_LEVEL@
 SOURCE = main.c internal_functions.c snprintf.c php3_sprintf.c \
        configuration-parser.c configuration-scanner.c request_info.c \
        safe_mode.c fopen-wrappers.c php3_realpath.c alloca.c output.c \
-       php_ini.c php_compat.c
+       php_ini.c
 OBJS = main.o internal_functions.o snprintf.o php3_sprintf.o \
        configuration-parser.o configuration-scanner.o request_info.o \
        safe_mode.o fopen-wrappers.o php3_realpath.o alloca.o output.o \
-       php_ini.o php_compat.o
+       php_ini.o
 
 FUNCTIONS_SOURCE = functions/apache.c functions/fhttpd.c \
        functions/crypt.c functions/db.c functions/dl.c functions/filepro.c \
index 0a7617147b247d1936e9ae74697ff3ad86ad234a..5de911d484b9048e995d4a1076cd09d26e0c1758 100644 (file)
@@ -7,5 +7,5 @@ libphpext_standard_a_SOURCES=\
        html.c image.c info.c link.c mail.c math.c md5.c microtime.c \
        pack.c pageinfo.c rand.c reg.c soundex.c string.c \
        syslog.c type.c uniqid.c url.c iptc.c var.c quot_print.c \
-       cyr_convert.c
+       cyr_convert.c flock_compat.c
 
index 066c69420b94e351a9d61e697d74b79b66618822..8886db26690e0ab9d7f4751f82db463f6c7a4151 100644 (file)
@@ -13,7 +13,7 @@
    |                                                                      |
    |  B) the PHP License as published by the PHP Development Team and     |
    |     included in the distribution in the file: LICENSE                |
-   |                                                                      |
+   |                                                                                                 |
    | This program is distributed in the hope that it will be useful,      |
    | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
    | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
@@ -32,6 +32,7 @@
 #endif
 #include "php.h"
 #include "php_globals.h"
+#include "ext/standard/flock_compat.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -211,6 +212,7 @@ php3_module_entry php3_file_module_entry = {
        "PHP_file", php3_file_functions, php3_minit_file, NULL, NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES
 };
 
+
 static int flock_values[] = { LOCK_SH, LOCK_EX, LOCK_UN };
 
 /* {{{ proto bool flock(int fp, int operation)
similarity index 98%
rename from php_compat.c
rename to ext/standard/flock_compat.c
index 736180ac6bbdd78aa1b3aa9cf8401dd980996c4a..2d809a718f117bf54bcd0dc36c793788d28543d2 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <php.h>
 #include <errno.h>
-#include "php_compat.h"
+#include "ext/standard/flock_compat.h"
 
 #if HAVE_STRUCT_FLOCK
 #include <unistd.h>
@@ -45,7 +45,7 @@
 #endif
 
 #if !HAVE_FLOCK
-PHPAPI int flock(int fd, int operation)
+int flock(int fd, int operation)
 #if HAVE_STRUCT_FLOCK
 {
        struct flock flck;
@@ -173,8 +173,7 @@ PHPAPI int flock(int fd, int operation)
  * cannot distinguish between failure and a local broadcast address.
  */
 
-PHPAPI int
-inet_aton(const char *cp, struct in_addr *ap)
+int inet_aton(const char *cp, struct in_addr *ap)
 {
     int dots = 0;
     register unsigned long acc = 0, addr = 0;
diff --git a/ext/standard/flock_compat.h b/ext/standard/flock_compat.h
new file mode 100644 (file)
index 0000000..9478fef
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef _FLOCK_COMPAT_H
+#define _FLOCK_COMPAT_H
+
+#if !HAVE_FLOCK
+#      define LOCK_SH 1
+#      define LOCK_EX 2
+#      define LOCK_NB 4
+#      define LOCK_UN 8
+int flock(int fd, int operation);
+#endif
+
+#if WIN32|WINNT
+#      define fsync _commit
+#      define ftruncate chsize
+#endif /* WIN32|WINNT */
+
+#if !HAVE_INET_ATON
+extern int inet_aton(const char *, struct in_addr *);
+#endif
+
+#endif /* _FLOCK_COMPAT_H */
index b9db2614b9954f62c73c575cdec11ac5f9bb9d15..43457ba44a8882d6c13b1589ec53060369d2008f 100644 (file)
@@ -1297,7 +1297,7 @@ static char *_php3_memstr(char *s, char *c, size_t n, size_t m)
 {
     char *p;
 
-    for(p = s; (p - s) < n; p++)
+    for(p = s; ((size_t) (p - s)) < n; p++)
         if(memcmp(p, c, m) == 0)
             return p;
     return NULL;
index 141287ae55c066da0c944a4c2d164eaa89568085..b3e4173a7b4d0347980b323d5125a518627aa2b1 100644 (file)
 
 #define HAVE_TZSET 1
 /* Define if you have the flock function.  */
-#define HAVE_FLOCK 1
+#define HAVE_FLOCK 0
 
 /* Define if using alloca.c.  */
 /* #undef C_ALLOCA */
index 72434c72928a336845a4400b421add15b85209f3..305724ff24eda810f10674f4f1bfd5280b465598 100644 (file)
@@ -510,8 +510,6 @@ extern void phprestart(FILE *input_file);
 #define XtOffsetOf(s_type,field) XtOffset(s_type*,field)
 #endif
 
-#include "php_compat.h"
-
 #endif
 
 /*
diff --git a/main/php_compat.h b/main/php_compat.h
deleted file mode 100644 (file)
index 2c4aa3e..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef PHP_COMPAT_H
-#define PHP_COMPAT_H
-
-#if (WIN32|WINNT) & HAVE_BINDLIB
-#ifndef WINNT
-#define WINNT 1
-#endif
-#include "arpa/inet.h"
-#include "netdb.h"
-#include "arpa/nameser.h"
-#include "resolv.h"
-#endif
-
-#if !HAVE_FLOCK
-
-#define LOCK_SH 1
-#define LOCK_EX 2
-#define LOCK_NB 4
-#define LOCK_UN 8
-
-extern PHPAPI int flock(int fd, int operation);
-
-#endif
-
-#if WIN32|WINNT
-
-/* These were in win32/flock.h, dunno if they are really needed
-   (or maybe break something) */
-
-#define fsync _commit
-#define ftruncate chsize
-
-#endif /* WIN32|WINNT */
-
-#if !HAVE_INET_ATON
-extern PHPAPI int inet_aton(const char *, struct in_addr *);
-#endif
-
-#endif
index 53e3ffa2e9aacab865d8a0313927355f3e0ad0f1..11598045aa74d04ab2ea4387f73168dace10fdff 100644 (file)
--- a/php4.dsp
+++ b/php4.dsp
@@ -281,6 +281,10 @@ SOURCE=.\ext\standard\filestat.c
 # End Source File
 # Begin Source File
 
+SOURCE=.\ext\standard\flock_compat.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\ext\standard\formatted_print.c
 # End Source File
 # Begin Source File
@@ -421,6 +425,10 @@ SOURCE=.\ext\standard\file.h
 # End Source File
 # Begin Source File
 
+SOURCE=.\ext\standard\flock_compat.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\ext\standard\fsock.h
 # End Source File
 # Begin Source File