/**************************************************************************
*   Copyright 2000 Compaq Computer Corporation
*
*   COMPAQ Registered in U.S. Patent and Trademark Office.
*
*   Confidential computer software. Valid license from Compaq or authorized
*   sublicensor required for possession, use or copying. Consistent with
*   FAR 12.211 and 12.212, Commercial Computer Software, Computer Software
*   Documentation, and Technical Data for Commercial Items are licensed to
*   the U.S. Government under vendor's standard commercial license.
**************************************************************************/

#if !defined(_SETJMP_H_) && !defined(_SETJMP_H)

#if defined(__linux__)
#define _SETJMP_H
#else
#define _SETJMP_H_
#endif  /* __linux__ */

extern "C" {
namespace std {

#if defined(__linux__)
#define _JBLEN  (17)
#else
#define _JBLEN	(35+1+48)
#endif  /*  __linux__ */
typedef	long	jmp_buf[_JBLEN];
extern void	longjmp (jmp_buf, int);
}  /* namespace std */

/*  sigjmp_buf has been added avoid an error when
    using pthreads.  It is not added to namespace std  */
typedef long sigjmp_buf[_JBLEN];

#if defined(__linux__)
extern int __sigsetjmp (std::jmp_buf, int);
# define setjmp(env)    __sigsetjmp ((env), 1)
#else
extern int setjmp(std::jmp_buf);
#define setjmp(env) setjmp(env)
#endif  /* __linux__ */

}   /* extern "C" */

#endif /* _SETJMP_H_ */
