Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Reduce the visibility of stdio.h because it was loaded wrongly (ie, before _GNU_SOURC...
[simgrid.git] / src / xbt / ex.c
index e1cc355..29941d5 100644 (file)
@@ -180,18 +180,9 @@ void xbt_ex_setup_backtrace(xbt_ex_t *e)  {
         are set */ 
       p  = xbt_strdup(backtrace[i]);
       p2 = strrchr(p,'(');
-      if (p2) { 
-        *p2= '\0';
-      } else { 
-        p2 = strrchr(p,' ');
-        if(p2 == NULL) 
-          {
-            ERROR1("Couldn't parse %s to get the library path", backtrace[i]);
-            xbt_abort();
-          }
-        
-        *p2= '\0';
-      }
+      if (p2) *p2= '\0';
+      p2 = strrchr(p,' ');
+      if(p2) *p2= '\0';
       
       /* Here we go, fire an addr2line up */
       subcmd = bprintf("%s -f -e %s %s",ADDR2LINE,p, addrs[i]);
@@ -276,8 +267,9 @@ void __xbt_ex_terminate_default(xbt_ex_t *e)  {
 }
 
 /* the externally visible API */
-ex_ctx_cb_t  __xbt_ex_ctx       = &__xbt_ex_ctx_default;
-ex_term_cb_t __xbt_ex_terminate = &__xbt_ex_terminate_default;
+ex_ctx_cb_t XBT_PUBLIC_DATA  __xbt_ex_ctx       = &__xbt_ex_ctx_default;
+ex_term_cb_t XBT_PUBLIC_DATA __xbt_ex_terminate = &__xbt_ex_terminate_default;
+
 
 void xbt_ex_free(xbt_ex_t e) {
   int i;
@@ -322,6 +314,7 @@ int backtrace (void **__array, int __size) {
 #endif
 
 #ifdef SIMGRID_TEST
+#include <stdio.h>
 #include "xbt/ex.h"
 
 XBT_TEST_SUITE("xbt_ex","Exception Handling");