commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1091305 - in /commons/sandbox/runtime/trunk/src/main/native: include/acr/jniapi.h os/unix/init.c os/unix/platform.c
Date Tue, 12 Apr 2011 06:31:06 GMT
Author: mturk
Date: Tue Apr 12 06:31:06 2011
New Revision: 1091305

URL: http://svn.apache.org/viewvc?rev=1091305&view=rev
Log:
Namespace protect global variables

Modified:
    commons/sandbox/runtime/trunk/src/main/native/include/acr/jniapi.h
    commons/sandbox/runtime/trunk/src/main/native/os/unix/init.c
    commons/sandbox/runtime/trunk/src/main/native/os/unix/platform.c

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/jniapi.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/jniapi.h?rev=1091305&r1=1091304&r2=1091305&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/jniapi.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/jniapi.h Tue Apr 12 06:31:06
2011
@@ -50,19 +50,19 @@ typedef struct acr_tlsd_t  {
 } acr_tlsd_t;
 
 #if HAVE_THREAD_LOCAL
-extern ACR_THREAD acr_exc_t     _exception_frame;
+extern ACR_THREAD acr_exc_t     acr_exception_frame;
 #if defined(WINDOWS)
 /* Use Microsoft Structured Exception Handling wrapper
  * The _set_se_translator is used to call the AcrExceptionHandler.
  * This requires the /EHa exception model to be used
  */
 #define __SEH_TRY                                                           \
-    _exception_frame.file = __FILE__;                                       \
-    _exception_frame.line = __LINE__;                                       \
-    _exception_frame.func = __REAL_FUNCSIG__;                               \
-    _exception_frame.desc = 0;                                              \
-    _exception_frame.code = 0;                                              \
-    _exception_frame.init = 1;                                              \
+    acr_exception_frame.file = __FILE__;                                    \
+    acr_exception_frame.line = __LINE__;                                    \
+    acr_exception_frame.func = __REAL_FUNCSIG__;                            \
+    acr_exception_frame.desc = 0;                                           \
+    acr_exception_frame.code = 0;                                           \
+    acr_exception_frame.init = 1;                                           \
     try
 
 #define __SEH_CATCH                                                         \
@@ -74,13 +74,13 @@ extern ACR_THREAD acr_exc_t     _excepti
  * with code set to signal number
  */
 #define __SEH_TRY                                                           \
-    _exception_frame.file = __FILE__;                                       \
-    _exception_frame.line = __LINE__;                                       \
-    _exception_frame.func = __REAL_FUNCSIG__;                               \
-    _exception_frame.desc = 0;                                              \
-    _exception_frame.code = 0;                                              \
-    _exception_frame.init = 1;                                              \
-    if (sigsetjmp(_exception_frame.jump, 1) == 0)
+    acr_exception_frame.file = __FILE__;                                    \
+    acr_exception_frame.line = __LINE__;                                    \
+    acr_exception_frame.func = __REAL_FUNCSIG__;                            \
+    acr_exception_frame.desc = 0;                                           \
+    acr_exception_frame.code = 0;                                           \
+    acr_exception_frame.init = 1;                                           \
+    if (sigsetjmp(acr_exception_frame.jump, 1) == 0)
 
 #define __SEH_CATCH                                                         \
     else

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/init.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/init.c?rev=1091305&r1=1091304&r2=1091305&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/init.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/init.c Tue Apr 12 06:31:06 2011
@@ -26,7 +26,7 @@ static pthread_key_t   _threadkey;
 static volatile int    _threadkey_inited = 0;
 static pthread_mutex_t _lib_mutex  = PTHREAD_MUTEX_INITIALIZER;
 #if HAVE_THREAD_LOCAL
-ACR_THREAD acr_exc_t   _exception_frame;
+ACR_THREAD acr_exc_t   acr_exception_frame;
 #endif
 
 typedef struct tlsd_t
@@ -152,18 +152,20 @@ AcrGetJNIEnv()
 void AcrExceptionHandler(int sig)
 {
     if (sig == SIGSEGV || sig == SIGBUS) {
-        if (_exception_frame.init) {
+        if (acr_exception_frame.init) {
+            acr_exception_frame.init = 0;
+            acr_exception_frame.code = sig;
 #if defined(_DEBUG) || defined(DEBUG)
-            AcrDebugPrintf(_exception_frame.file, _exception_frame.func,
-                           _exception_frame.line,
+            AcrDebugPrintf(acr_exception_frame.file,
+                           acr_exception_frame.func,
+                           acr_exception_frame.line,
                            "Executing SEH handler for %s", strsignal(sig));
 #endif
-            _exception_frame.code = sig;
-            _exception_frame.init = 0;
-            siglongjmp(_exception_frame.jump, 1);
+            siglongjmp(acr_exception_frame.jump, 1);
         }
         else {
-            // TODO: Call original signal handlers
+            /* TODO: Call original signal handlers.
+             */
             abort();
         }
     }    

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/platform.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/platform.c?rev=1091305&r1=1091304&r2=1091305&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/platform.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/platform.c Tue Apr 12 06:31:06 2011
@@ -38,11 +38,11 @@ ACR_JNI_EXPORT(void, Platform, init1)(JN
     UNREFERENCED_OBJECT;
     (*env)->GetIntArrayRegion(env, p, 0, 16, ia);
 
-    ia[0]  = sizeof(int);
-    ia[1]  = sizeof(long);
-    ia[2]  = sizeof(size_t);
-    ia[3]  = sizeof(void *);
-    ia[4]  = sizeof(wchar_t);
+    ia[0]  = ISIZEOF(int);
+    ia[1]  = ISIZEOF(long);
+    ia[2]  = ISIZEOF(size_t);
+    ia[3]  = ISIZEOF(void *);
+    ia[4]  = ISIZEOF(wchar_t);
 #if CC_SIZEOF_VOIDP == 8
     ia[5]  = 64;
 #else



Mime
View raw message