summaryrefslogtreecommitdiff
path: root/libiberty/dummy.c
blob: 08da647e30eba83bd6f9cad8bd8589ef446fa0d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <ansidecl.h>

#ifdef __STDC__
#include <stddef.h>
#define clock_t unsigned long
#define DEF(NAME, RETURN_TYPE, ARGLIST, ARGS) extern RETURN_TYPE NAME (ARGS);
#define DEFFUNC(NAME, RETURN_TYPE, ARGLIST, ARGS) extern RETURN_TYPE NAME (ARGS);
#else
#define void int
#define size_t unsigned long
#define clock_t unsigned long
#define DEF(NAME, RETURN_TYPE, ARGLIST, ARGS) extern RETURN_TYPE NAME ();
#define DEFFUNC(NAME, RETURN_TYPE, ARGLIST, ARGS) extern RETURN_TYPE NAME ();
#endif

#define DEFVAR(NAME,DECL,USE) extern DECL;

#define NOTHING /*nothing*/

#include "alloca-conf.h"
#include "functions.def"

/* Always use our: getopt.o getopt1.o obstack.o spaces.o */

int
main (argc, argv)
     int argc; char **argv;
{

/* Create a dummy function call for each DEF-defined function. */

#undef DEF
#undef DEFVAR
#undef DEFFUNC
#undef AND
#define AND = 0;
/* ARGS expands into a set of declaration.  NAME ARG_LIST expands
   info a function call that uses those variables as actual parameters.
   If the function has been DEF'ed correctly, we can pass the right
   number and types of parameters, which is nice.  (E.g. gcc may
   otherwise complain about the wrong number of parameters to certain
   builtins.) */
#define DEF(NAME, RETURN_TYPE, ARG_LIST, ARGS) { ARGS; NAME ARG_LIST; }
#define DEFVAR(NAME, DECL, USE) { USE; }
#define DEFFUNC(NAME, RETURN_TYPE, ARG_LIST, ARGS) { ARGS; NAME ARG_LIST; }
#include "functions.def"

  return (0);
}