summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/lib/win32main.c
blob: 0eb6385dd9451e6e8d8e4e209ef0c0ea7f6f11a6 (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
#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 (void);
extern TEXDLL void maininit (int, string *);

int
main (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;
}