3 // ============================================================================
7 * Writing code that is portable between platforms with or without
8 * native C++ exceptions is hard. The following macros offer some
9 * help on this task, mostly oriented to making the ORB code and the
10 * IDL generated code portable.
12 * @author Nanbor Wang <nanbor@cs.wustl.edu>
13 * @author Aniruddha Gokhale <gokhale@sahyadri.research.bell-labs.com>
14 * @author Carlos O'Ryan <coryan@uci.edu>, et al.
16 // ============================================================================
18 // Macros for handling CORBA exceptions.
20 #ifndef ACE_CORBA_MACROS_H
21 #define ACE_CORBA_MACROS_H
23 #include /**/ "ace/pre.h"
25 #include /**/ "ace/config-all.h"
27 #if !defined (ACE_LACKS_PRAGMA_ONCE)
29 #endif /* ACE_LACKS_PRAGMA_ONCE */
31 #define ACE_NEW_THROW_EX(POINTER,CONSTRUCTOR,EXCEPTION) \
32 do { POINTER = new (std::nothrow) CONSTRUCTOR; \
33 if (POINTER == nullptr) { throw EXCEPTION; } \
36 // FUZZ: disable check_for_ACE_Guard
37 # define ACE_GUARD_THROW_EX(MUTEX,OBJ,LOCK,EXCEPTION) \
38 ACE_Guard< MUTEX > OBJ (LOCK); \
39 if (!OBJ.locked ()) throw EXCEPTION;
41 # define ACE_READ_GUARD_THROW_EX(MUTEX,OBJ,LOCK,EXCEPTION) \
42 ACE_Read_Guard< MUTEX > OBJ (LOCK); \
43 if (!OBJ.locked ()) throw EXCEPTION;
45 # define ACE_WRITE_GUARD_THROW_EX(MUTEX,OBJ,LOCK,EXCEPTION) \
46 ACE_Write_Guard< MUTEX > OBJ (LOCK); \
47 if (!OBJ.locked ()) throw EXCEPTION;
48 // FUZZ: enable check_for_ACE_Guard
50 #include /**/ "ace/post.h"
52 #endif /* ACE_CORBA_MACROS_H */