summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/lib/win32main.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/lib/win32main.c')
-rw-r--r--Build/source/texk/web2c/lib/win32main.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/lib/win32main.c b/Build/source/texk/web2c/lib/win32main.c
new file mode 100644
index 00000000000..aa1c1f865d7
--- /dev/null
+++ b/Build/source/texk/web2c/lib/win32main.c
@@ -0,0 +1,30 @@
+#include "config.h"
+
+/* The entry point: set up for reading the command line, which will
+ happen in `topenin', then call the main body. Public domain. */
+
+extern TEXDLL void mainbody P1H(void);
+extern TEXDLL void maininit P2H(int, string *);
+
+int
+main P2C(int, ac, string *, av)
+{
+#ifdef __EMX__
+ _wildcard (&ac, &av);
+ _response (&ac, &av);
+#endif
+
+#if defined(WIN32)
+ /* if _DEBUG is not defined, these macros will result in nothing. */
+ SETUP_CRTDBG;
+ /* Set the debug-heap flag so that freed blocks are kept on the
+ linked list, to catch any inadvertent use of freed memory */
+ SET_CRT_DEBUG_FIELD( _CRTDBG_DELAY_FREE_MEM_DF );
+#endif
+
+ maininit(ac, av);
+
+ /* Call the real main program. */
+ mainbody ();
+ return EXIT_SUCCESS;
+}