|
Last change
on this file since 645 was 2, checked in by bird, 23 years ago |
|
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | /* STARTUP PROCEDURE FOR UNIX FORTRAN PROGRAMS */
|
|---|
| 2 |
|
|---|
| 3 | #include <stdio.h>
|
|---|
| 4 | #include "signal1.h"
|
|---|
| 5 |
|
|---|
| 6 | #ifndef KR_headers
|
|---|
| 7 | #undef VOID
|
|---|
| 8 | #include <stdlib.h>
|
|---|
| 9 | #endif
|
|---|
| 10 |
|
|---|
| 11 | #ifndef VOID
|
|---|
| 12 | #define VOID void
|
|---|
| 13 | #endif
|
|---|
| 14 |
|
|---|
| 15 | #ifdef __cplusplus
|
|---|
| 16 | extern "C" {
|
|---|
| 17 | #endif
|
|---|
| 18 |
|
|---|
| 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
|
|---|
| 36 |
|
|---|
| 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
|
|---|
| 44 |
|
|---|
| 45 | #ifdef __cplusplus
|
|---|
| 46 | }
|
|---|
| 47 | #endif
|
|---|
| 48 |
|
|---|
| 49 | #ifdef KR_headers
|
|---|
| 50 | main(argc, argv) int argc; char **argv;
|
|---|
| 51 | #else
|
|---|
| 52 | main(int argc, char **argv)
|
|---|
| 53 | #endif
|
|---|
| 54 | {
|
|---|
| 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. */
|
|---|
| 68 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.