Browse Source

setjmp.h: sync with glibc

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Peter S. Mazinger 13 years ago
parent
commit
12bfecef4c
1 changed files with 22 additions and 10 deletions
  1. 22 10
      include/setjmp.h

+ 22 - 10
include/setjmp.h

@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1999, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1999,2001,2002,2007,2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
@@ -30,8 +30,9 @@ __BEGIN_DECLS
 #include <bits/setjmp.h>		/* Get `__jmp_buf'.  */
 #include <bits/setjmp.h>		/* Get `__jmp_buf'.  */
 #include <bits/sigset.h>		/* Get `__sigset_t'.  */
 #include <bits/sigset.h>		/* Get `__sigset_t'.  */
 
 
+
 /* Calling environment, plus possibly a saved signal mask.  */
 /* Calling environment, plus possibly a saved signal mask.  */
-typedef struct __jmp_buf_tag	/* C++ doesn't like tagless structs.  */
+struct __jmp_buf_tag
   {
   {
     /* NOTE: The machine-dependent definitions of `__sigsetjmp'
     /* NOTE: The machine-dependent definitions of `__sigsetjmp'
        assume that a `jmp_buf' begins with a `__jmp_buf' and that
        assume that a `jmp_buf' begins with a `__jmp_buf' and that
@@ -40,23 +41,29 @@ typedef struct __jmp_buf_tag	/* C++ doesn't like tagless structs.  */
     __jmp_buf __jmpbuf;		/* Calling environment.  */
     __jmp_buf __jmpbuf;		/* Calling environment.  */
     int __mask_was_saved;	/* Saved the signal mask?  */
     int __mask_was_saved;	/* Saved the signal mask?  */
     __sigset_t __saved_mask;	/* Saved signal mask.  */
     __sigset_t __saved_mask;	/* Saved signal mask.  */
-  } jmp_buf[1];
+  };
+
+
+__BEGIN_NAMESPACE_STD
 
 
+typedef struct __jmp_buf_tag jmp_buf[1];
 
 
 /* Store the calling environment in ENV, also saving the signal mask.
 /* Store the calling environment in ENV, also saving the signal mask.
    Return 0.  */
    Return 0.  */
 extern int setjmp (jmp_buf __env) __THROW;
 extern int setjmp (jmp_buf __env) __THROW;
 
 
-/* Store the calling environment in ENV, not saving the signal mask.
-   Return 0.  */
-extern int _setjmp (jmp_buf __env) __THROW;
+__END_NAMESPACE_STD
 
 
 /* Store the calling environment in ENV, also saving the
 /* Store the calling environment in ENV, also saving the
    signal mask if SAVEMASK is nonzero.  Return 0.
    signal mask if SAVEMASK is nonzero.  Return 0.
    This is the internal name for `sigsetjmp'.  */
    This is the internal name for `sigsetjmp'.  */
-extern int __sigsetjmp (jmp_buf __env, int __savemask) __THROW;
+extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __THROW;
 
 
 #ifndef	__FAVOR_BSD
 #ifndef	__FAVOR_BSD
+/* Store the calling environment in ENV, not saving the signal mask.
+   Return 0.  */
+extern int _setjmp (struct __jmp_buf_tag __env[1]) __THROW;
+
 /* Do not save the signal mask.  This is equivalent to the `_setjmp'
 /* Do not save the signal mask.  This is equivalent to the `_setjmp'
    BSD function.  */
    BSD function.  */
 # define setjmp(env)	_setjmp (env)
 # define setjmp(env)	_setjmp (env)
@@ -68,15 +75,20 @@ extern int __sigsetjmp (jmp_buf __env, int __savemask) __THROW;
 #endif /* Favor BSD.  */
 #endif /* Favor BSD.  */
 
 
 
 
+__BEGIN_NAMESPACE_STD
+
 /* Jump to the environment saved in ENV, making the
 /* Jump to the environment saved in ENV, making the
    `setjmp' call there return VAL, or 1 if VAL is 0.  */
    `setjmp' call there return VAL, or 1 if VAL is 0.  */
-extern void longjmp (jmp_buf __env, int __val)
+extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
      __THROW __attribute__ ((__noreturn__));
      __THROW __attribute__ ((__noreturn__));
+
+__END_NAMESPACE_STD
+
 #if defined __USE_BSD || defined __USE_XOPEN
 #if defined __USE_BSD || defined __USE_XOPEN
 /* Same.  Usually `_longjmp' is used with `_setjmp', which does not save
 /* Same.  Usually `_longjmp' is used with `_setjmp', which does not save
    the signal mask.  But it is how ENV was saved that determines whether
    the signal mask.  But it is how ENV was saved that determines whether
    `longjmp' restores the mask; `_longjmp' is just an alias.  */
    `longjmp' restores the mask; `_longjmp' is just an alias.  */
-extern void _longjmp (jmp_buf __env, int __val)
+extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
      __THROW __attribute__ ((__noreturn__));
      __THROW __attribute__ ((__noreturn__));
 #endif
 #endif
 
 
@@ -85,7 +97,7 @@ extern void _longjmp (jmp_buf __env, int __val)
 /* Use the same type for `jmp_buf' and `sigjmp_buf'.
 /* Use the same type for `jmp_buf' and `sigjmp_buf'.
    The `__mask_was_saved' flag determines whether
    The `__mask_was_saved' flag determines whether
    or not `longjmp' will restore the signal mask.  */
    or not `longjmp' will restore the signal mask.  */
-typedef jmp_buf sigjmp_buf;
+typedef struct __jmp_buf_tag sigjmp_buf[1];
 
 
 /* Store the calling environment in ENV, also saving the
 /* Store the calling environment in ENV, also saving the
    signal mask if SAVEMASK is nonzero.  Return 0.  */
    signal mask if SAVEMASK is nonzero.  Return 0.  */