home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c495 / watcm951.arj / STARTUP.386 / CMAIN386.C next >
Encoding:
C/C++ Source or Header  |  1993-02-16  |  1.4 KB  |  41 lines

  1. /*
  2.  *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  3.  *%       Copyright (C) 1986,1991 by WATCOM Systems Inc. All rights %
  4.  *%       reserved. No part of this software may be reproduced      %
  5.  *%       in any form or by any means - graphic, electronic or      %
  6.  *%       mechanical, including photocopying, recording, taping     %
  7.  *%       or information storage and retrieval systems - except     %
  8.  *%       with the written permission of WATCOM Systems Inc.        %
  9.  *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  10.  
  11.   Modified:     By:             Reason:
  12.   ---------     ---             -------
  13.   22-nov-86     F.W.Crigger     Initial implementation
  14.   19-nov-92    F.W.Crigger    __CommonInit() and _init_files moved to cinit
  15. */
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18. #include <malloc.h>
  19.  
  20. extern    int        ___Argc;    /* argument count */
  21. extern    char        **___Argv;    /* argument vector */
  22. extern    unsigned    __ASTACKSIZ;    /* alternate stack size */
  23. extern    char        *__ASTACKPTR;    /* alternate stack pointer */
  24.  
  25. extern    void    __CommonInit( void );
  26. extern    int    main( int, char ** );
  27.  
  28. #pragma aux     __CMain  "*";
  29.  
  30. #pragma    aux    __ASTACKPTR "*"
  31. #pragma    aux    __ASTACKSIZ "*"
  32.  
  33. void __CMain()
  34. /************/
  35. {
  36.     /* allocate alternate stack for F77 */
  37.     __ASTACKPTR = (char *)alloca( __ASTACKSIZ ) + __ASTACKSIZ;
  38.     __CommonInit();
  39.     exit( main( ___Argc, ___Argv ) );
  40. }
  41.