3 Copyright (C) 1986-2018 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program 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 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
26 #undef PACKAGE_VERSION
28 #undef PACKAGE_TARNAME
31 #include "build-gnulib-gdbserver/config.h"
33 #include "build-gnulib/config.h"
37 #undef PACKAGE_VERSION
39 #undef PACKAGE_TARNAME
42 https://www.gnu.org/software/gnulib/manual/html_node/stdint_002eh.html
44 "On some hosts that predate C++11, when using C++ one must define
45 __STDC_CONSTANT_MACROS to make visible the definitions of constant
46 macros such as INTMAX_C, and one must define __STDC_LIMIT_MACROS to
47 make visible the definitions of limit macros such as INTMAX_MAX.".
50 https://www.gnu.org/software/gnulib/manual/html_node/inttypes_002eh.html
52 "On some hosts that predate C++11, when using C++ one must define
53 __STDC_FORMAT_MACROS to make visible the declarations of format
54 macros such as PRIdMAX."
56 Must do this before including any system header, since other system
57 headers may include stdint.h/inttypes.h. */
58 #define __STDC_CONSTANT_MACROS 1
59 #define __STDC_LIMIT_MACROS 1
60 #define __STDC_FORMAT_MACROS 1
62 /* Some distros enable _FORTIFY_SOURCE by default, which on occasion
63 has caused build failures with -Wunused-result when a patch is
64 developed on a distro that does not enable _FORTIFY_SOURCE. We
65 enable it here in order to try to catch these problems earlier;
66 plus this seems like a reasonable safety measure. The check for
67 optimization is required because _FORTIFY_SOURCE only works when
68 optimization is enabled. */
70 #if defined __OPTIMIZE__ && __OPTIMIZE__ > 0
71 #define _FORTIFY_SOURCE 2
81 #include <strings.h> /* for strcasecmp and strncasecmp */
87 /* This is defined by ansidecl.h, but we prefer gnulib's version. On
88 MinGW, gnulib might enable __USE_MINGW_ANSI_STDIO, which may or not
89 require use of attribute gnu_printf instead of printf. gnulib
90 checks that at configure time. Since _GL_ATTRIBUTE_FORMAT_PRINTF
91 is compatible with ATTRIBUTE_PRINTF, simply use it. */
92 #undef ATTRIBUTE_PRINTF
93 #define ATTRIBUTE_PRINTF _GL_ATTRIBUTE_FORMAT_PRINTF
95 #include "libiberty.h"
97 #include "gdb/signals.h"
98 #include "gdb_locale.h"
100 #include "common-types.h"
101 #include "common-utils.h"
102 #include "gdb_assert.h"
104 #include "print-utils.h"
105 #include "common-debug.h"
106 #include "cleanups.h"
107 #include "common-exceptions.h"
108 #include "common/poison.h"
110 #define EXTERN_C extern "C"
111 #define EXTERN_C_PUSH extern "C" {
112 #define EXTERN_C_POP }
114 /* Pull in gdb::unique_xmalloc_ptr. */
115 #include "common/gdb_unique_ptr.h"
117 /* String containing the current directory (what getwd would return). */
118 extern char *current_directory
;
120 /* sbrk on macOS is not useful for our purposes, since sbrk(0) always
121 returns the same value. brk/sbrk on macOS is just an emulation
122 that always returns a pointer to a 4MB section reserved for
125 #if defined (HAVE_SBRK) && !__APPLE__
126 #define HAVE_USEFUL_SBRK 1
129 #endif /* COMMON_DEFS_H */
This page took 0.039503 seconds and 4 git commands to generate.