* configure.target (cpu_include_dir): Set to `config/cpu/m68k' for
[official-gcc.git] / libf2c / libF77 / main.c
blob17bf449e40242655541a5559b0db9406f6a95d07
1 /* STARTUP PROCEDURE FOR UNIX FORTRAN PROGRAMS */
3 #include <stdio.h>
4 #include "signal1.h"
6 #ifndef KR_headers
7 #undef VOID
8 #include <stdlib.h>
9 #endif
11 #ifndef VOID
12 #define VOID void
13 #endif
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
19 #ifdef NO__STDC
20 #define ONEXIT onexit
21 extern VOID f_exit();
22 #else
23 #ifndef KR_headers
24 extern void f_exit(void);
25 #ifndef NO_ONEXIT
26 #define ONEXIT atexit
27 extern int atexit(void (*)(void));
28 #endif
29 #else
30 #ifndef NO_ONEXIT
31 #define ONEXIT onexit
32 extern VOID f_exit();
33 #endif
34 #endif
35 #endif
37 #ifdef KR_headers
38 extern VOID f_init();
39 extern int MAIN__();
40 #else
41 extern void f_init(void);
42 extern int MAIN__(void);
43 #endif
45 #ifdef __cplusplus
47 #endif
49 #ifdef KR_headers
50 main(argc, argv) int argc; char **argv;
51 #else
52 main(int argc, char **argv)
53 #endif
55 f_setarg(argc, argv);
56 f_setsig();
57 f_init();
58 #ifndef NO_ONEXIT
59 ONEXIT(f_exit);
60 #endif
61 MAIN__();
62 #ifdef NO_ONEXIT
63 f_exit();
64 #endif
65 exit(0); /* exit(0) rather than return(0) to bypass Cray bug */
66 return 0; /* For compilers that complain of missing return values; */
67 /* others will complain that this is unreachable code. */