commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r809153 - in /commons/sandbox/runtime/trunk/src/main/native: include/arch/unix/acr_arch.h include/arch/windows/acr_arch_private.h test/testsuite.c
Date Sat, 29 Aug 2009 16:13:06 GMT
Author: mturk
Date: Sat Aug 29 16:13:05 2009
New Revision: 809153

URL: http://svn.apache.org/viewvc?rev=809153&view=rev
Log:
Add 64-bit printf formatting macros

Modified:
    commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h
    commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h
    commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c

Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h?rev=809153&r1=809152&r2=809153&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h Sat Aug 29
16:13:05 2009
@@ -31,6 +31,16 @@
 #define ACR_FORCEINLINE inline
 #endif
 
+#if CC_SIZEOF_LONG == 8
+#define ACR_INT64_T_FMT          "ld"
+#define ACR_UINT64_T_FMT         "lu"
+#define ACR_UINT64_T_HEX_FMT     "lx"
+#else
+#define ACR_INT64_T_FMT          "lld"
+#define ACR_UINT64_T_FMT         "llu"
+#define ACR_UINT64_T_HEX_FMT     "llx"
+#endif
+
 #define ACR_ARCHIMPL_CLASS_PATH   ACR_CLASS_PATH "platform/unix/"
 #define ACR_JNI_ARCHIMPL_DECLARE(RT, CL, FN)  \
     JNIEXPORT RT JNICALL Java_org_apache_commons_runtime_platform_unix_##CL##_##FN

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=809153&r1=809152&r2=809153&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
Sat Aug 29 16:13:05 2009
@@ -51,6 +51,10 @@
 #define ACR_INLINE      __inline
 #define ACR_FORCEINLINE __forceinline
 
+#define ACR_INT64_T_FMT          "I64d"
+#define ACR_UINT64_T_FMT         "I64u"
+#define ACR_UINT64_T_HEX_FMT     "I64x"
+
 /**
  * @file acr_arch_private.h
  * @brief

Modified: commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c?rev=809153&r1=809152&r2=809153&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c Sat Aug 29 16:13:05 2009
@@ -434,13 +434,13 @@
     }
     d2 = ACR_Acr2DosTime(test_2002);
     printf("Dos Time 1 is %04x - %04x\n",  d2 >> 16, d2 & 0xffff);
-    printf("Acr Time 1 is %lld\n", ACR_Dos2AcrTime(d2));
-    printf("Acr Time 1 is %lld\n", ACR_Dos2AcrTime(d2+1));
+    printf("Acr Time 1 is %" ACR_INT64_T_FMT "\n", ACR_Dos2AcrTime(d2));
+    printf("Acr Time 1 is %" ACR_INT64_T_FMT "\n", ACR_Dos2AcrTime(d2+1));
 
     d2 = ACR_Acr2DosTime(test_1980);
     printf("Dos Time 0 is %04x - %04x\n",  d2 >> 16, d2 & 0xffff);
-    printf("Acr Time 0 is %lld\n", ACR_Dos2AcrTime(d2));
-    printf("Acr Time 0 is %lld\n", ACR_Dos2AcrTime(d2+1));
+    printf("Acr Time 0 is %" ACR_INT64_T_FMT "\n", ACR_Dos2AcrTime(d2));
+    printf("Acr Time 0 is %" ACR_INT64_T_FMT "\n", ACR_Dos2AcrTime(d2+1));
 
     tests_failed += failed;
     if (failed)



Mime
View raw message