2014-07-24 22:35:45 +08:00
|
|
|
/* Common definitions.
|
|
|
|
|
2015-01-01 17:32:14 +08:00
|
|
|
Copyright (C) 1986-2015 Free Software Foundation, Inc.
|
2014-07-24 22:35:45 +08:00
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
|
|
|
|
#ifndef COMMON_DEFS_H
|
|
|
|
#define COMMON_DEFS_H
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#ifdef GDBSERVER
|
|
|
|
#include "build-gnulib-gdbserver/config.h"
|
|
|
|
#else
|
|
|
|
#include "build-gnulib/config.h"
|
|
|
|
#endif
|
|
|
|
|
common-defs.h: include <stdarg.h> before <stdio.h>
When trying to build gdbserver on ppc-lynx178, the compiler reports
while trying to compile gdbserver/ax.c that vsprintf is not declared.
Looking at my C99 reference manual (a draft), I see the following
synopsis:
#include <stdarg.h>
#include <stdio.h>
int vsprintf(char * restrict s, [etc]);
Looking at stdio.h on LynxOS-178, if found where vsprintf gets
declared:
#if defined(__varargs_h) || defined(__stdarg_h) \
|| defined(_VARARGS_H) || defined(_STDARG_H)
extern int vsprintf _AP((char *, const char *, va_list));
#endif
Digging further, I noticed that common-defs.h, which is included
via server.h, includes stdarg.h after including stdio, explaining
why vsprintf does not get declared in this case.
This patch fixes the problem by including stdarg.h before stdio.h.
gdb/ChangeLog:
* common/common-defs.h: Move <stdarg.h> #include ahead of
<stdio.h> #include.
Tested on x86_64-linux.
2014-10-07 02:50:46 +08:00
|
|
|
#include <stdarg.h>
|
2014-07-25 23:29:40 +08:00
|
|
|
#include <stdio.h>
|
2014-07-26 00:35:30 +08:00
|
|
|
#include <stdlib.h>
|
2014-07-28 20:15:41 +08:00
|
|
|
#include <stddef.h>
|
2015-01-16 04:10:49 +08:00
|
|
|
#include <stdint.h>
|
2014-07-29 22:06:51 +08:00
|
|
|
#include <string.h>
|
2014-07-30 20:21:40 +08:00
|
|
|
#include <errno.h>
|
2014-11-21 22:05:41 +08:00
|
|
|
#include <alloca.h>
|
2014-07-28 19:03:31 +08:00
|
|
|
#include "ansidecl.h"
|
2014-07-28 20:52:38 +08:00
|
|
|
#include "libiberty.h"
|
2014-07-28 21:04:00 +08:00
|
|
|
#include "pathmax.h"
|
2014-07-28 21:09:12 +08:00
|
|
|
#include "gdb/signals.h"
|
2014-07-28 21:21:31 +08:00
|
|
|
#include "gdb_locale.h"
|
2014-07-28 21:28:06 +08:00
|
|
|
#include "ptid.h"
|
2014-07-28 21:35:17 +08:00
|
|
|
#include "common-utils.h"
|
2014-07-29 21:47:21 +08:00
|
|
|
#include "gdb_assert.h"
|
2014-07-30 21:09:07 +08:00
|
|
|
#include "errors.h"
|
2014-07-30 22:31:10 +08:00
|
|
|
#include "common-types.h"
|
2014-07-30 23:14:21 +08:00
|
|
|
#include "print-utils.h"
|
2014-07-30 23:21:55 +08:00
|
|
|
#include "common-debug.h"
|
2014-10-08 16:33:22 +08:00
|
|
|
#include "cleanups.h"
|
2014-10-08 16:33:22 +08:00
|
|
|
#include "common-exceptions.h"
|
2014-07-25 23:29:40 +08:00
|
|
|
|
2014-07-24 22:35:45 +08:00
|
|
|
#endif /* COMMON_DEFS_H */
|