summaryrefslogtreecommitdiff
path: root/libf2c/libF77/main.c
blob: 9f41947b97732f0d04eeebe74e86450f66e41a17 (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
/* STARTUP PROCEDURE FOR UNIX FORTRAN PROGRAMS */

#include <stdio.h>
#include "signal1.h"

#undef VOID
#include <stdlib.h>

#ifndef VOID
#define VOID void
#endif

#ifdef __cplusplus
extern "C" {
#endif

extern void f_exit(void);
#ifndef NO_ONEXIT
#define ONEXIT atexit
extern int atexit(void (*)(void));
#endif

extern void f_init(void);
extern int MAIN__(void);

#ifdef __cplusplus
	}
#endif

main(int argc, char **argv)
{
f_setarg(argc, argv);
f_setsig();
f_init();
#ifndef NO_ONEXIT
ONEXIT(f_exit);
#endif
MAIN__();
#ifdef NO_ONEXIT
f_exit();
#endif
exit(0);	/* exit(0) rather than return(0) to bypass Cray bug */
return 0;	/* For compilers that complain of missing return values; */
		/* others will complain that this is unreachable code. */
}