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