You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/09/10 09:55:56 UTC

svn commit: r813282 - in /commons/sandbox/runtime/trunk/src/main/native: Makefile.msc.in configure include/arch/windows/acr_arch.h include/arch/windows/acr_arch_private.h os/win32/env.c os/win32/main.c srclib/zlib/zconf.h

Author: mturk
Date: Thu Sep 10 07:55:55 2009
New Revision: 813282

URL: http://svn.apache.org/viewvc?rev=813282&view=rev
Log:
MSVC 2005 and later fixes

Modified:
    commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in
    commons/sandbox/runtime/trunk/src/main/native/configure
    commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h
    commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h
    commons/sandbox/runtime/trunk/src/main/native/os/win32/env.c
    commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c
    commons/sandbox/runtime/trunk/src/main/native/srclib/zlib/zconf.h

Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in?rev=813282&r1=813281&r2=813282&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in (original)
+++ commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in Thu Sep 10 07:55:55 2009
@@ -114,7 +114,9 @@
 	$(SRCDIR)/os/win32/ios.$(OBJ) \
 	$(SRCDIR)/os/win32/mmap.$(OBJ) \
 	$(SRCDIR)/os/win32/mutex.$(OBJ) \
+	$(SRCDIR)/os/win32/registry.$(OBJ) \
 	$(SRCDIR)/os/win32/sema.$(OBJ) \
+	$(SRCDIR)/os/win32/service.$(OBJ) \
 	$(SRCDIR)/os/win32/shm.$(OBJ) \
 	$(SRCDIR)/os/win32/signals.$(OBJ) \
 	$(SRCDIR)/os/win32/subsys.$(OBJ) \

Modified: commons/sandbox/runtime/trunk/src/main/native/configure
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/configure?rev=813282&r1=813281&r2=813282&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/configure (original)
+++ commons/sandbox/runtime/trunk/src/main/native/configure Thu Sep 10 07:55:55 2009
@@ -610,7 +610,11 @@
 int main() {return 0;}
 EOF
     rc=0
-    co="`$cc $ccflags $cppopts $test.c -o $test$exe 2>&1`"
+    if [ ".$host" = .windows ]; then
+        co="`$cc $ccflags $cppopts $test.c /link /out:$test$exe 2>&1`"
+    else
+        co="`$cc $ccflags $cppopts $test.c -o $test$exe 2>&1`"    
+    fi
     if [ ".$co" = "." ]; then
         rc=1
     else
@@ -641,7 +645,11 @@
 int main() {return 0;}
 EOF
     rc=0
-    co="`$cc $ccflags $cppopts $test.c -o $test$exe -l$1 2>&1`"
+    if [ ".$host" = .windows ]; then
+        co="`$cc $ccflags $cppopts $test.c /link /out:$test$exe $1 2>&1`"
+    else
+        co="`$cc $ccflags $cppopts $test.c -o $test$exe -l$1 2>&1`"    
+    fi
     if [ ".$co" = "." ]; then
         rc=1
     else
@@ -673,7 +681,11 @@
 int main() { return $1 (); }
 EOF
     rc=0
-    co="`$cc $ccflags $cppopts $ldflags $test.c -o $test$exe 2>&1`"
+    if [ ".$host" = .windows ]; then
+        co="`$cc $ccflags $cppopts $ldflags $test.c /link /out:$test$exe 2>&1`"
+    else
+        co="`$cc $ccflags $cppopts $ldflags $test.c -o $test$exe 2>&1`"    
+    fi
     if [ ".$co" = . ]; then
         rc=1
     else
@@ -715,7 +727,11 @@
 int main() {return (int)($1);}
 EOF
     rc=0
-    co="`$cc $ccflags $cppopts $test.c -o $test$exe 2>&1`"
+    if [ ".$host" = .windows ]; then
+        co="`$cc $ccflags $cppopts $test.c /link /out:$test$exe 2>&1`"
+    else
+        co="`$cc $ccflags $cppopts $test.c -o $test$exe 2>&1`"    
+    fi
     if [ ".$co" = . ]; then
         rc=1
     else
@@ -742,7 +758,11 @@
 int main() {printf("%d", (int)sizeof($1));return 0;}
 EOF
     rc=""
-    $cc $ccflags $cppopts $ldflags $test.c -o $test$exe >/dev/null 2>&1
+    if [ ".$host" = .windows ]; then
+        $cc $ccflags $cppopts $ldflags $test.c /link /out:$test$exe >/dev/null 2>&1
+    else
+        $cc $ccflags $cppopts $ldflags $test.c -o $test$exe >/dev/null 2>&1
+    fi
     test -x $test$exe && rc=`./$test$exe 2>/dev/null`
     rm -rf $test.* $test *.pdb >/dev/null 2>&1 || true
     test ".$rc" = . && rc="0"

Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h?rev=813282&r1=813281&r2=813282&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h Thu Sep 10 07:55:55 2009
@@ -518,14 +518,14 @@
     const char *envstring),
     (envstring));
 #undef  _crt_putenv
-#define _crt_putenv acr_winapi_putenv
+#define _crt_putenv acr_winapi__putenv
 
 ACR_DECLARE_LATE_DLL_FUNC(SYSDLL_MSVCRT, int, -1,
                           _cdecl, _wputenv, 0, (
     const wchar_t *envstring),
     (envstring));
 #undef  _crt_wputenv
-#define _crt_wputenv acr_winapi_wputenv
+#define _crt_wputenv acr_winapi__wputenv
 
 ACR_DECLARE_LATE_DLL_FUNC(SYSDLL_KERNEL32, BOOL, FALSE,
                           WINAPI, GetSystemTimes, 0, (

Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h?rev=813282&r1=813281&r2=813282&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h Thu Sep 10 07:55:55 2009
@@ -31,7 +31,7 @@
 #include <wtsapi32.h>
 
 #if defined(NTDDI_VISTA)
-#if defined(NTDDI_VERSION >= NTDDI_VISTA)
+#if NTDDI_VERSION >= NTDDI_VISTA
 #define ACR_HAVE_VISTA_SDK  1
 #else
 #define ACR_HAVE_VISTA_SDK  0

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/env.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/env.c?rev=813282&r1=813281&r2=813282&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/env.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/env.c Thu Sep 10 07:55:55 2009
@@ -26,7 +26,9 @@
 {
     char       *cpy;
     char       *cp;
-
+#if defined(_MSC_VER) && (_MSC_VER >= 1300)
+    int         ret;
+#endif
     /*
      * Each version of MSVCRT has its own _putenv() call in the runtime
      * library.
@@ -80,6 +82,9 @@
 {
     wchar_t    *cpy;
     wchar_t    *cp;
+#if defined(_MSC_VER) && (_MSC_VER >= 1300)
+    int         ret;
+#endif
 
     /*
      * Each version of MSVCRT has its own _putenv() call in the runtime

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c?rev=813282&r1=813281&r2=813282&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c Thu Sep 10 07:55:55 2009
@@ -312,7 +312,12 @@
     while (sePrivileges[i]) {
         if ((rc = ACR_EnablePrivilege(sePrivileges[i])) != ERROR_SUCCESS) {
             WCHAR buf[128];
-            swprintf(buf, L"Failed enabling %s", sePrivileges[i]);
+#if _MSC_VER >= 1300
+            swprintf(buf, sizeof(buf),
+#else
+            swprintf(buf,
+#endif
+                     L"Failed enabling %s", sePrivileges[i]);
             /* Log that we couldn't set privilege */
             acr_init_log_source(NULL);
             do_syslog(ACR_LOG_WARN, buf, rc);

Modified: commons/sandbox/runtime/trunk/src/main/native/srclib/zlib/zconf.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/srclib/zlib/zconf.h?rev=813282&r1=813281&r2=813282&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/srclib/zlib/zconf.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/srclib/zlib/zconf.h Thu Sep 10 07:55:55 2009
@@ -227,6 +227,10 @@
 #endif
 
 #if defined(WINDOWS) || defined(WIN32)
+#  if defined(_MSC_VER) && (_MSC_VER >= 1300)
+#     define HAVE_VSNPRINTF
+#  endif
+
    /* If building or using zlib as a DLL, define ZLIB_DLL.
     * This is not mandatory, but it offers a little performance increase.
     */