18
18
#define NEED_SIGJMP 1
19
19
#endif
20
20
21
+ // By default, the ExceptionContext_t class is expected in the namespace
22
+ // CppyyLegacy, If it is expected in no namespace, one can explicitly define
23
+ // NO_CPPYY_LEGACY_NAMESPACE at build time (e.g. if one wants to use ROOT).
24
+
25
+ #ifndef NO_CPPYY_LEGACY_NAMESPACE
21
26
namespace CppyyLegacy {
27
+ #endif
22
28
struct ExceptionContext_t {
23
29
#ifdef NEED_SIGJMP
24
30
sigjmp_buf fBuf ;
25
31
#else
26
32
jmp_buf fBuf ;
27
33
#endif
28
34
};
35
+ #ifndef NO_CPPYY_LEGACY_NAMESPACE
29
36
}
30
37
38
+ using CppyyExceptionContext_t = CppyyLegacy::ExceptionContext_t;
39
+ #else
40
+ using CppyyExceptionContext_t = ExceptionContext_t;
41
+ #endif
42
+
31
43
#ifdef NEED_SIGJMP
32
44
# define CLING_EXCEPTION_SETJMP (buf ) sigsetjmp(buf,1 )
33
45
#else
@@ -36,14 +48,14 @@ struct ExceptionContext_t {
36
48
37
49
#define CLING_EXCEPTION_RETRY \
38
50
{ \
39
- static CppyyLegacy::ExceptionContext_t R__curr, *R__old = gException ; \
51
+ static CppyyExceptionContext_t R__curr, *R__old = gException ; \
40
52
int R__code; \
41
53
gException = &R__curr; \
42
54
R__code = CLING_EXCEPTION_SETJMP (gException ->fBuf ); if (R__code) { }; {
43
55
44
56
#define CLING_EXCEPTION_TRY \
45
57
{ \
46
- static CppyyLegacy::ExceptionContext_t R__curr, *R__old = gException ; \
58
+ static CppyyExceptionContext_t R__curr, *R__old = gException ; \
47
59
int R__code; \
48
60
gException = &R__curr; \
49
61
if ((R__code = CLING_EXCEPTION_SETJMP (gException ->fBuf )) == 0 ) {
@@ -59,6 +71,6 @@ struct ExceptionContext_t {
59
71
gException = R__old; \
60
72
}
61
73
62
- CPYCPPYY_IMPORT CppyyLegacy::ExceptionContext_t *gException ;
74
+ CPYCPPYY_IMPORT CppyyExceptionContext_t *gException ;
63
75
64
76
#endif
0 commit comments