Attempt to fix PSEH compilation for kernel-mode targets. Arty please test this
authorKJK::Hyperion <hackbunny@reactos.org>
Fri, 18 Jun 2004 22:33:06 +0000 (22:33 +0000)
committerKJK::Hyperion <hackbunny@reactos.org>
Fri, 18 Jun 2004 22:33:06 +0000 (22:33 +0000)
svn path=/trunk/; revision=9716

reactos/include/pseh/framebased.h
reactos/tools/helper.mk

index 344e0d0..a203a04 100644 (file)
 #define KJK_PSEH_FRAMEBASED_H_
 
 #include <pseh/framebased/internal.h>
-#include <excpt.h>
 
+/* Safeguards against broken SDK/CRT headers */
+#ifndef _SEH_NO_SYSTEM_HEADERS
+# include <excpt.h>
+#endif
+
+#ifndef offsetof
+# include <stddef.h>
+#endif
+
+/*
+ Fall back to non-optimal, non-native NLG implementation for environments
+ without their own (e.g., currently, kernel-mode ReactOS/Windows)
+*/
 #ifdef _SEH_NO_NATIVE_NLG
-#include <pseh/setjmp.h>
-#define longjmp _SEHLongJmp
-#define setjmp _SEHSetJmp
-#define jmp_buf _SEHJmpBuf_t
+# include <pseh/setjmp.h>
+# define longjmp _SEHLongJmp
+# define setjmp _SEHSetJmp
+# define jmp_buf _SEHJmpBuf_t
 #else
-#include <setjmp.h>
+# include <setjmp.h>
 #endif
 
-#include <stddef.h>
-
 typedef struct __SEHFrame
 {
  _SEHPortableFrame_t SEH_Header;
index bbc7fce..71875be 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: helper.mk,v 1.67 2004/06/05 09:47:35 hbirr Exp $
+# $Id: helper.mk,v 1.68 2004/06/18 22:33:06 hyperion Exp $
 #
 # Helper makefile for ReactOS modules
 # Variables this makefile accepts:
@@ -583,8 +583,8 @@ endif
 ifeq ($(MK_MODE),kernel)
   MK_DEFBASE := 0x10000
   MK_LIBS := $(addprefix $(DDK_PATH_LIB)/, $(TARGET_DDKLIBS) $(MK_DDKLIBS))
-  MK_CFLAGS += -D_SEH_NO_NATIVE_NLG
-  MK_CPPFLAGS += -D_SEH_NO_NATIVE_NLG
+  MK_CFLAGS += -D_SEH_NO_NATIVE_NLG -D_SEH_NO_SYSTEM_HEADERS
+  MK_CPPFLAGS += -D_SEH_NO_NATIVE_NLG -D_SEH_NO_SYSTEM_HEADERS
 endif