setjmp.h 1.2 KB
Newer Older
1
/*
2
 *  GRUB  --  GRand Unified Bootloader
3
 *  Copyright (C) 2003,2006,2007  Free Software Foundation, Inc.
4
 *
5
 *  GRUB is free software: you can redistribute it and/or modify
6
 *  it under the terms of the GNU General Public License as published by
7
 *  the Free Software Foundation, either version 3 of the License, or
8 9
 *  (at your option) any later version.
 *
10
 *  GRUB is distributed in the hope that it will be useful,
11 12 13 14 15
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
16
 *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
17 18
 */

19 20
#ifndef GRUB_SETJMP_HEADER
#define GRUB_SETJMP_HEADER	1
21

22
#if defined(GRUB_UTIL)
23
#include <setjmp.h>
24 25 26
typedef jmp_buf grub_jmp_buf;
#define grub_setjmp setjmp
#define grub_longjmp longjmp
27
#else
28 29 30 31 32 33 34 35 36

#include <grub/misc.h>

#if GNUC_PREREQ(4,0)
#define RETURNS_TWICE __attribute__ ((returns_twice))
#else
#define RETURNS_TWICE
#endif

37 38 39
/* This must define grub_jmp_buf, and declare grub_setjmp and
   grub_longjmp.  */
# include <grub/cpu/setjmp.h>
40
#endif
41

42
#endif /* ! GRUB_SETJMP_HEADER */