Initial revision
[sbcl.git] / src / runtime / undefineds.c
1 /*
2  * routines that must be linked into the core for Lisp to work
3  */
4
5 /*
6  * This software is part of the SBCL system. See the README file for
7  * more information.
8  *
9  * This software is derived from the CMU CL system, which was
10  * written at Carnegie Mellon University and released into the
11  * public domain. The software is in the public domain and is
12  * provided with absolutely no warranty. See the COPYING and CREDITS
13  * files for more information.
14  */
15
16 /*
17  * $Header$
18  */
19
20 #ifdef sun
21 #ifndef MACH
22 #if !defined(SUNOS) && !defined(SOLARIS)
23 #define SUNOS
24 #endif
25 #endif
26 #endif
27
28 typedef int func();
29
30 extern func
31 #define F(x) x,
32 #if !(defined(irix) || defined(SOLARIS))
33 /* XXXfixme next line probably wrong; was previous behavior */
34 #define D(x) x,
35 #else
36 #define D(x)
37 #endif
38 #include "undefineds.h"
39 #undef F
40 #undef D
41 exit; /* just some function known to exist */
42
43 #if defined(SOLARIS) || defined(irix)
44
45 #ifdef irix
46 int errno; /* hack to be sure works with newer libc without having to redump */
47            /* causes libc to be relocated to match cmucl rather than vice
48             * versa */
49 #endif
50
51 extern int
52 #define F(x)
53 #define D(x) x,
54 #include "undefineds.h"
55 #undef F
56 #undef D
57 errno;                          /* a variable known to exist */
58
59 int reference_random_symbols(void) {
60    int a;
61 #define F(x) x();
62 #define D(x) a+=x;
63 #include "undefineds.h"
64 #undef F
65 #undef D
66    return a;
67    }
68
69 #else
70
71 func *reference_random_symbols[] = {
72 #define F(x) x,
73    /* XXXfixme Next line is probably wrong but was previous behavior. */
74 #define D(x) x,
75 #include "undefineds.h"
76 #undef F
77 #undef D
78    exit                         /* a function known to exist */
79 };
80
81 #endif