sysdep.h 2.1 KB

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