This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Check for ucontext.h and sys/ucontext.h
On Sun, Nov 04, 2001 at 12:14:16PM -0800, Geoff Keating wrote:
> This would also work, except:
OK, how about this:
Index: linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/linux.h,v
retrieving revision 1.31
diff -u -r1.31 linux.h
--- linux.h 2001/10/31 14:32:29 1.31
+++ linux.h 2001/11/04 20:31:08
@@ -219,11 +219,21 @@
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
+
#ifdef IN_LIBGCC2
-#include <signal.h>
-#include <sys/ucontext.h>
-#endif
+# include <features.h>
+# include <sys/types.h>
+# include <signal.h>
+
+# if ( __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 0))
+# include <sys/ucontext.h>
+# else
+# include <sigcontext.h>
+# endif
+#endif /* IN_LIBGCC2 */
+
+#if ( __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 0))
#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
do { \
unsigned char *pc_ = (CONTEXT)->ra; \
@@ -277,3 +287,5 @@
(FS)->retaddr_column = 8; \
goto SUCCESS; \
} while (0)
+#endif
+
--
Craig Rodrigues
http://www.gis.net/~craigr
rodrigc@mediaone.net