aboutsummaryrefslogtreecommitdiff
path: root/desiredata/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'desiredata/src/main.c')
-rw-r--r--desiredata/src/main.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/desiredata/src/main.c b/desiredata/src/main.c
new file mode 100644
index 00000000..cf4a6593
--- /dev/null
+++ b/desiredata/src/main.c
@@ -0,0 +1,17 @@
+/* this file is separate because it is outside of libpd.so */
+
+extern "C" int sys_main(int argc, char **argv);
+#if _MSC_VER
+#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 MSVC */
+int main(int argc, char **argv) {return sys_main(argc, argv);}
+#endif
+