pajoye Mon Oct 20 14:45:59 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/fileinfo config.w32
/php-src/ext/fileinfo/libmagic apprentice.c softmagic.c
Log:
- support for VC6 and some other platforms (before some other cleanup)
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/config.w32?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/fileinfo/config.w32
diff -u php-src/ext/fileinfo/config.w32:1.1.2.2
php-src/ext/fileinfo/config.w32:1.1.2.3
--- php-src/ext/fileinfo/config.w32:1.1.2.2 Thu Jul 31 13:13:20 2008
+++ php-src/ext/fileinfo/config.w32 Mon Oct 20 14:45:59 2008
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.1.2.2 2008/07/31 13:13:20 pajoye Exp $
+// $Id: config.w32,v 1.1.2.3 2008/10/20 14:45:59 pajoye Exp $
// vim:ft=javascript
ARG_ENABLE("fileinfo", "fileinfo support", "no");
@@ -13,6 +13,10 @@
magic.c print.c \
readelf.c softmagic.c";
+ if (VCVERS <1500) {
+ ADD_FLAG('CFLAGS', '/Zm1000');
+ }
+
EXTENSION('fileinfo', 'fileinfo.c', true, "/I" +
configure_module_dirname + "/libmagic /I" + configure_module_dirname);
ADD_SOURCES(configure_module_dirname + '\\libmagic',
LIBMAGIC_SOURCES, "fileinfo");
} else {
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/apprentice.c?r1=1.7.2.7&r2=1.7.2.8&diff_format=u
Index: php-src/ext/fileinfo/libmagic/apprentice.c
diff -u php-src/ext/fileinfo/libmagic/apprentice.c:1.7.2.7
php-src/ext/fileinfo/libmagic/apprentice.c:1.7.2.8
--- php-src/ext/fileinfo/libmagic/apprentice.c:1.7.2.7 Wed Oct 15 22:56:57 2008
+++ php-src/ext/fileinfo/libmagic/apprentice.c Mon Oct 20 14:45:59 2008
@@ -38,11 +38,17 @@
#ifdef PHP_WIN32
#include "win32/unistd.h"
+#if _MSC_VER <= 1300
+#include "win32/php_strtoi64.h"
+#endif
#define strtoull _strtoui64
#else
#include <unistd.h>
#endif
+
+
+
#include <string.h>
#include <assert.h>
#include <ctype.h>
http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/libmagic/softmagic.c?r1=1.1.2.5&r2=1.1.2.6&diff_format=u
Index: php-src/ext/fileinfo/libmagic/softmagic.c
diff -u php-src/ext/fileinfo/libmagic/softmagic.c:1.1.2.5
php-src/ext/fileinfo/libmagic/softmagic.c:1.1.2.6
--- php-src/ext/fileinfo/libmagic/softmagic.c:1.1.2.5 Wed Oct 15 22:56:57 2008
+++ php-src/ext/fileinfo/libmagic/softmagic.c Mon Oct 20 14:45:59 2008
@@ -582,16 +582,16 @@
if (m->num_mask) \
switch (m->mask_op & FILE_OPS_MASK) { \
case FILE_OPADD: \
- p->fld += cast m->num_mask; \
+ p->fld += cast (int64_t)m->num_mask; \
break; \
case FILE_OPMINUS: \
- p->fld -= cast m->num_mask; \
+ p->fld -= cast (int64_t)m->num_mask; \
break; \
case FILE_OPMULTIPLY: \
- p->fld *= cast m->num_mask; \
+ p->fld *= cast (int64_t)m->num_mask; \
break; \
case FILE_OPDIVIDE: \
- p->fld /= cast m->num_mask; \
+ p->fld /= cast (int64_t)m->num_mask; \
break; \
} \
@@ -1860,7 +1860,7 @@
case 'x':
if ((ms->flags & MAGIC_DEBUG) != 0)
(void) fprintf(stderr, "%llu == *any* = 1\n",
- (unsigned long long)v);
+ (uint64_t)v);
matched = 1;
break;
@@ -1868,7 +1868,7 @@
matched = v != l;
if ((ms->flags & MAGIC_DEBUG) != 0)
(void) fprintf(stderr, "%llu != %llu = %d\n",
- (unsigned long long)v, (unsigned long long)l,
+ (uint64_t)v, (uint64_t)l,
matched);
break;
@@ -1876,7 +1876,7 @@
matched = v == l;
if ((ms->flags & MAGIC_DEBUG) != 0)
(void) fprintf(stderr, "%llu == %llu = %d\n",
- (unsigned long long)v, (unsigned long long)l,
+ (uint64_t)v, (uint64_t)l,
matched);
break;
@@ -1885,14 +1885,14 @@
matched = v > l;
if ((ms->flags & MAGIC_DEBUG) != 0)
(void) fprintf(stderr, "%llu > %llu = %d\n",
- (unsigned long long)v,
- (unsigned long long)l, matched);
+ (uint64_t)v,
+ (uint64_t)l, matched);
}
else {
matched = (int64_t) v > (int64_t) l;
if ((ms->flags & MAGIC_DEBUG) != 0)
(void) fprintf(stderr, "%lld > %lld = %d\n",
- (long long)v, (long long)l, matched);
+ (uint64_t)v, (uint64_t)l, matched);
}
break;
@@ -1901,14 +1901,14 @@
matched = v < l;
if ((ms->flags & MAGIC_DEBUG) != 0)
(void) fprintf(stderr, "%llu < %llu = %d\n",
- (unsigned long long)v,
- (unsigned long long)l, matched);
+ (uint64_t)v,
+ (uint64_t)l, matched);
}
else {
matched = (int64_t) v < (int64_t) l;
if ((ms->flags & MAGIC_DEBUG) != 0)
(void) fprintf(stderr, "%lld < %lld = %d\n",
- (long long)v, (long long)l, matched);
+ (int64_t)v, (int64_t)l, matched);
}
break;
@@ -1916,16 +1916,16 @@
matched = (v & l) == l;
if ((ms->flags & MAGIC_DEBUG) != 0)
(void) fprintf(stderr, "((%llx & %llx) == %llx) = %d\n",
- (unsigned long long)v, (unsigned long long)l,
- (unsigned long long)l, matched);
+ (uint64_t)v, (uint64_t)l,
+ (uint64_t)l, matched);
break;
case '^':
matched = (v & l) != l;
if ((ms->flags & MAGIC_DEBUG) != 0)
(void) fprintf(stderr, "((%llx & %llx) != %llx) = %d\n",
- (unsigned long long)v, (unsigned long long)l,
- (unsigned long long)l, matched);
+ (uint64_t)v, (uint64_t)l,
+ (uint64_t)l, matched);
break;
default:
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php