aboutsummaryrefslogtreecommitdiff
path: root/pd/src/s_entry.c
blob: eb49cfc1b8256efcd9e73fc56d0c2211388b71e0 (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
/* In MSW, this is all there is to pd; the rest sits in a "pdlib" dll so
that externs can link back to functions defined in pd. */

int sys_main(int argc, char **argv);

#ifdef MSW
#include <windows.h>
#include <stdio.h>

int WINAPI WinMain(HINSTANCE hInstance,
                               HINSTANCE hPrevInstance,
                               LPSTR lpCmdLine,
                               int nCmdShow)
{ 
    __try {
        sys_main(__argc,__argv);
    }
    __finally
    { 
        printf("caught an exception; stopping\n");
    }
}

#else /* not MSW */
int main(int argc, char **argv)
{
    return (sys_main(argc, argv));
}
#endif