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