Author: tkreuzer
Date: Mon Dec 27 17:55:53 2010
New Revision: 50166
URL:
http://svn.reactos.org/svn/reactos?rev=50166&view=rev
Log:
[PSEH]
Allow configuration of native SEH vs PSEH vs dummy PSEH with macro definitions
(USE_NATIVE_SEH, USE_DUMMY_PSEH)
Modified:
trunk/reactos/include/reactos/libs/pseh/pseh2.h
Modified: trunk/reactos/include/reactos/libs/pseh/pseh2.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/pseh/…
==============================================================================
--- trunk/reactos/include/reactos/libs/pseh/pseh2.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/libs/pseh/pseh2.h [iso-8859-1] Mon Dec 27 17:55:53 2010
@@ -19,16 +19,37 @@
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
-#ifdef _M_AMD64
-#include "pseh2_64.h"
-#else
#ifndef KJK_PSEH2_H_
#define KJK_PSEH2_H_
-#if !defined (__arm__) && !defined(__clang__)
-
-#if defined(__GNUC__)
+#if defined(USE_DUMMY_PSEH) || defined (__arm__) || defined(__clang__) ||
defined(_M_AMD64)
+
+#define _SEH2_TRY {
+#define _SEH2_FINALLY } {
+#define _SEH2_EXCEPT(...) } if (0) {
+#define _SEH2_END }
+#define _SEH2_GetExceptionInformation()
+#define _SEH2_GetExceptionCode() 0
+#define _SEH2_AbnormalTermination()
+#define _SEH2_YIELD(STMT_) STMT_
+#define _SEH2_LEAVE
+
+#elif defined(USE_NATIVE_SEH) || defined(_MSC_VER)
+
+#include <excpt.h>
+#define _SEH2_TRY __try
+#define _SEH2_FINALLY __finally
+#define _SEH2_EXCEPT(...) __except(__VA_ARGS__)
+#define _SEH2_END
+#define _SEH2_GetExceptionInformation() (GetExceptionInformation())
+#define _SEH2_GetExceptionCode() (GetExceptionCode())
+#define _SEH2_AbnormalTermination() (AbnormalTermination())
+#define _SEH2_YIELD(STMT_) STMT_
+#define _SEH2_LEAVE __leave
+
+#elif defined(__GNUC__)
+
struct _EXCEPTION_RECORD;
struct _EXCEPTION_POINTERS;
struct _CONTEXT;
@@ -76,8 +97,7 @@
_SEH2HandleTryLevel_t;
#ifdef __cplusplus
-extern "C"
-{
+extern "C" {
#endif
extern int __cdecl _SEH2EnterFrameAndTrylevel(_SEH2Frame_t *, volatile _SEH2TryLevel_t
*);
@@ -369,41 +389,11 @@
__SEH_END_SCOPE_CHAIN;
+
#else
-
-#include <excpt.h>
-
-#define _SEH2_TRY __try
-#define _SEH2_FINALLY __finally
-#define _SEH2_EXCEPT(...) __except(__VA_ARGS__)
-#define _SEH2_END
-
-#define _SEH2_GetExceptionInformation() (GetExceptionInformation())
-#define _SEH2_GetExceptionCode() (GetExceptionCode())
-#define _SEH2_AbnormalTermination() (AbnormalTermination())
-
-#define _SEH2_YIELD(STMT_) STMT_
-#define _SEH2_LEAVE __leave
-
+#error no PSEH support
#endif
-#else
-
-#define _SEH2_TRY {
-#define _SEH2_FINALLY } {
-#define _SEH2_EXCEPT(...) } if (0) {
-#define _SEH2_END }
-
-#define _SEH2_GetExceptionInformation()
-#define _SEH2_GetExceptionCode() 0
-#define _SEH2_AbnormalTermination()
-
-#define _SEH2_YIELD(STMT_) STMT_
-#define _SEH2_LEAVE
-
-#endif
-
-#endif
-#endif
+#endif /* !KJK_PSEH2_H_ */
/* EOF */