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