]> git.kaiwu.me - nginx.git/commitdiff
Win32: Open Watcom C compatibility fixes.
authorMaxim Dounin <mdounin@mdounin.ru>
Wed, 4 Sep 2013 16:48:22 +0000 (20:48 +0400)
committerMaxim Dounin <mdounin@mdounin.ru>
Wed, 4 Sep 2013 16:48:22 +0000 (20:48 +0400)
Precompiled headers are disabled as they lead to internal compiler errors
with long configure lines.  Couple of false positive warnings silenced.
Various win32 typedefs are adjusted to work with Open Watcom C 1.9 headers.

With this patch, it's now again possible to compile nginx using owc386,
with options we normally compile on win32 minus ipv6 and ssl.

auto/cc/owc
auto/lib/pcre/makefile.owc
src/core/ngx_string.c
src/http/modules/ngx_http_mp4_module.c
src/os/win32/ngx_win32_config.h

index 22eb4c1259a22b04529186b27b02a8537822ffd5..a063aa34121a7f11ff07eef9fd1b6a47d37ec46a 100644 (file)
@@ -65,10 +65,10 @@ have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have
 
 
 # the precompiled headers
-CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch"
-NGX_PCH="$NGX_OBJS/ngx_config.pch"
-NGX_BUILD_PCH="-fhq=$NGX_OBJS/ngx_config.pch"
-NGX_USE_PCH="-fh=$NGX_OBJS/ngx_config.pch"
+#CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch"
+#NGX_PCH="$NGX_OBJS/ngx_config.pch"
+#NGX_BUILD_PCH="-fhq=$NGX_OBJS/ngx_config.pch"
+#NGX_USE_PCH="-fh=$NGX_OBJS/ngx_config.pch"
 
 
 # the link flags, built target is NT GUI mode application
index 78f5257b3e6fc5f4e489d2796faa35f66c625958..122fd5b27f206ae9f0858d1f7dcb0f8c0456ded3 100644 (file)
@@ -4,7 +4,7 @@
 
 
 CFLAGS =       -c -zq -bt=nt -ot -op -oi -oe -s -bm $(CPU_OPT)
-PCREFLAGS =    -DHAVE_CONFIG_H -DPCRE_STATIC -DPOSIX_MALLOC_THRESHOLD=10 \
+PCREFLAGS =    -DHAVE_CONFIG_H -DPCRE_STATIC -DPOSIX_MALLOC_THRESHOLD=10 &
                -DSUPPORT_PCRE8 -DHAVE_MEMMOVE
 
 
index 3b392f7b27d1c66cd4b2ebe141112a8f5ccf55e9..d3ff36855fb17a0fbc4b2da36a7da5e7b2b37dfc 100644 (file)
@@ -486,7 +486,7 @@ ngx_sprintf_num(u_char *buf, u_char *last, uint64_t ui64, u_char zero,
 
     if (hexadecimal == 0) {
 
-        if (ui64 <= NGX_MAX_UINT32_VALUE) {
+        if (ui64 <= (uint64_t) NGX_MAX_UINT32_VALUE) {
 
             /*
              * To divide 64-bit numbers and to find remainders
index f9281a371e3b5c8366e7a907d15f5e0fab6d34ff..680b6587105484269fd4a8b827286c01a593359e 100644 (file)
@@ -1129,7 +1129,7 @@ ngx_http_mp4_update_mdat_atom(ngx_http_mp4_file_t *mp4, off_t start_offset)
 
     atom_header = mp4->mdat_atom_header;
 
-    if ((uint64_t) atom_data_size > 0xffffffff) {
+    if ((uint64_t) atom_data_size > (uint64_t) 0xffffffff) {
         atom_size = 1;
         atom_header_size = sizeof(ngx_mp4_atom_header64_t);
         ngx_mp4_set_64value(atom_header + sizeof(ngx_mp4_atom_header_t),
index 62356985561504e532341a08cae93590e5516733..7face954fa2a40d7eda7fe43f9fcee8c277de2d1 100644 (file)
@@ -128,13 +128,27 @@ typedef unsigned short int  uint16_t;
 
 typedef __int64             int64_t;
 typedef unsigned __int64    uint64_t;
+
+#ifndef __WATCOMC__
 typedef int                 intptr_t;
 typedef u_int               uintptr_t;
+#endif
+
 
 /* Windows defines off_t as long, which is 32-bit */
 typedef __int64             off_t;
 #define _OFF_T_DEFINED
 
+#ifdef __WATCOMC__
+
+/* off_t is redefined by sys/types.h used by zlib.h */
+#define __TYPES_H_INCLUDED
+typedef int                 dev_t;
+typedef unsigned int        ino_t;
+
+#endif
+
+
 typedef int                 ssize_t;
 typedef uint32_t            in_addr_t;
 typedef u_short             in_port_t;