2014-07-24 14:35:45 +00:00
|
|
|
/* Common definitions.
|
|
|
|
|
2015-01-01 09:32:14 +00:00
|
|
|
Copyright (C) 1986-2015 Free Software Foundation, Inc.
|
2014-07-24 14:35:45 +00: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-06 18:50:46 +00:00
|
|
|
#include <stdarg.h>
|
2014-07-25 15:29:40 +00:00
|
|
|
#include <stdio.h>
|
2014-07-25 16:35:30 +00:00
|
|
|
#include <stdlib.h>
|
2014-07-28 12:15:41 +00:00
|
|
|
#include <stddef.h>
|
2015-01-15 20:10:49 +00:00
|
|
|
#include <stdint.h>
|
2014-07-29 14:06:51 +00:00
|
|
|
#include <string.h>
|
2014-07-30 12:21:40 +00:00
|
|
|
#include <errno.h>
|
2014-11-21 14:05:41 +00:00
|
|
|
#include <alloca.h>
|
2014-07-28 11:03:31 +00:00
|
|
|
#include "ansidecl.h"
|
2014-07-28 12:52:38 +00:00
|
|
|
#include "libiberty.h"
|
2014-07-28 13:04:00 +00:00
|
|
|
#include "pathmax.h"
|
2014-07-28 13:09:12 +00:00
|
|
|
#include "gdb/signals.h"
|
2014-07-28 13:21:31 +00:00
|
|
|
#include "gdb_locale.h"
|
2014-07-28 13:28:06 +00:00
|
|
|
#include "ptid.h"
|
2014-07-28 13:35:17 +00:00
|
|
|
#include "common-utils.h"
|
2014-07-29 13:47:21 +00:00
|
|
|
#include "gdb_assert.h"
|
2014-07-30 13:09:07 +00:00
|
|
|
#include "errors.h"
|
2014-07-30 14:31:10 +00:00
|
|
|
#include "common-types.h"
|
2014-07-30 15:14:21 +00:00
|
|
|
#include "print-utils.h"
|
2014-07-30 15:21:55 +00:00
|
|
|
#include "common-debug.h"
|
2014-10-08 08:33:22 +00:00
|
|
|
#include "cleanups.h"
|
2014-10-08 08:33:22 +00:00
|
|
|
#include "common-exceptions.h"
|
2014-07-25 15:29:40 +00:00
|
|
|
|
2014-07-24 14:35:45 +00:00
|
|
|
#endif /* COMMON_DEFS_H */
|