Import gdb-7.10.1
[dragonfly.git] / contrib / gdb-7 / opcodes / sysdep.h
CommitLineData
5796c8dc 1/* Random host-dependent support code.
25e4902b 2 Copyright (C) 1995-2015 Free Software Foundation, Inc.
5796c8dc
SS
3 Written by Ken Raeburn.
4
5 This file is part of the GNU opcodes library.
6
7 This library is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
11
12 It is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
20 MA 02110-1301, USA. */
21
22
23/* Do system-dependent stuff, mainly driven by autoconf-detected info.
24
25 Well, some generic common stuff is done here too, like including
26 ansidecl.h. That's because the .h files in bfd/hosts files I'm
27 trying to replace often did that. If it can be dropped from this
28 file (check in a non-ANSI environment!), it should be. */
29
ef5ccd6c
JM
30#ifdef PACKAGE
31#error sysdep.h must be included in lieu of config.h
32#endif
33
5796c8dc
SS
34#include "config.h"
35
36#include "ansidecl.h"
37
38#ifdef HAVE_STDLIB_H
39#include <stdlib.h>
40#endif
41
ef5ccd6c
JM
42#ifdef STRING_WITH_STRINGS
43#include <string.h>
44#include <strings.h>
45#else
5796c8dc
SS
46#ifdef HAVE_STRING_H
47#include <string.h>
48#else
49#ifdef HAVE_STRINGS_H
50#include <strings.h>
51#endif
52#endif
ef5ccd6c 53#endif
5796c8dc
SS
54
55#if !HAVE_DECL_STPCPY
56extern char *stpcpy (char *__dest, const char *__src);
57#endif
25e4902b
AHJ
58
59/* Use sigsetjmp/siglongjmp without saving the signal mask if possible.
60 It is faster than setjmp/longjmp on systems where the signal mask is
61 saved. */
62
63#if defined(HAVE_SIGSETJMP)
64#define OPCODES_SIGJMP_BUF sigjmp_buf
65#define OPCODES_SIGSETJMP(buf) sigsetjmp((buf), 0)
66#define OPCODES_SIGLONGJMP(buf,val) siglongjmp((buf), (val))
67#else
68#define OPCODES_SIGJMP_BUF jmp_buf
69#define OPCODES_SIGSETJMP(buf) setjmp(buf)
70#define OPCODES_SIGLONGJMP(buf,val) longjmp((buf), (val))
71#endif