Ignore:
Timestamp:
Aug 16, 1999, 6:28:05 PM (26 years ago)
Author:
sandervl
Message:

Makefile changes & initterm.cpp no longer calls c/c++ library init & termination functions (should only be done in odincrt.dll)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ddraw/initterm.cpp

    r354 r510  
     1/* $Id: initterm.cpp,v 1.6 1999-08-16 16:28:02 sandervl Exp $ */
    12
    23/*
    3 
    4  * This file was created for Sander van Leeuwen
    5 
    6  * by Project Smarts on 8 May 1997.
    7 
     4 * DLL entry point
     5 *
     6 * Copyright 1998 Sander van Leeuwen
     7 * Copyright 1998 Peter Fitzsimmons
     8 *
     9 *
     10 * Project Odin Software License can be found in LICENSE.TXT
     11 *
    812 */
    913
     
    2327#define  INCL_DOSMODULEMGR
    2428#define  INCL_DOSPROCESS
    25 #include <os2wrap.h>
     29#include <os2wrap.h>    //Odin32 OS/2 api wrappers
    2630#include <stdlib.h>
    2731#include <stdio.h>
    2832#include <string.h>
    2933#include <odin.h>
    30 #include <misc.h>       /*PLF Wed  98-03-18 23:18:29*/
    31 
    32 extern "C" {
    33 /*-------------------------------------------------------------------*/
    34 /* _CRT_init is the C run-time environment initialization function.  */
    35 /* It will return 0 to indicate success and -1 to indicate failure.  */
    36 /*-------------------------------------------------------------------*/
    37 int CDECL CRT_init(void);
    38 /*-------------------------------------------------------------------*/
    39 /* _CRT_term is the C run-time environment termination function.     */
    40 /* It only needs to be called when the C run-time functions are      */
    41 /* statically linked.                                                */
    42 /*-------------------------------------------------------------------*/
    43 void CDECL CRT_term(void);
    44 void CDECL _ctordtorInit( void );
    45 void CDECL _ctordtorTerm( void );
    46 }
    47 /*-------------------------------------------------------------------*/
    48 /* A clean up routine registered with DosExitList must be used if    */
    49 /* runtime calls are required and the runtime is dynamically linked. */
    50 /* This will guarantee that this clean up routine is run before the  */
    51 /* library DLL is terminated.                                        */
    52 /*-------------------------------------------------------------------*/
    53 static void APIENTRY cleanup(ULONG reason);
    54 
    55 
     34#include <misc.h>       /*PLF Wed  98-03-18 23:18:15*/
    5635
    5736/****************************************************************************/
     
    6342/* calling this function.                                                   */
    6443/****************************************************************************/
    65 unsigned long _System _DLL_InitTerm(unsigned long hModule, unsigned long
    66                                     ulFlag)
     44unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long
     45                                   ulFlag)
    6746{
    6847   size_t i;
     
    7756   switch (ulFlag) {
    7857      case 0 :
    79 
    80          /*******************************************************************/
    81          /* The C run-time environment initialization function must be      */
    82          /* called before any calls to C run-time functions that are not    */
    83          /* inlined.                                                        */
    84          /*******************************************************************/
    85 
    86          if (CRT_init() == -1)
    87             return 0UL;
    88      _ctordtorInit();
    89 
    90 //SvL: Temporarily disabled
    91 #if 0
    92         CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
    93 #endif
    94 
    95          /*******************************************************************/
    96          /* A DosExitList routine must be used to clean up if runtime calls */
    97          /* are required and the runtime is dynamically linked.             */
    98          /*******************************************************************/
    99 
    100          rc = DosExitList(0x0000FF00|EXLST_ADD, cleanup);
    101          if(rc)
    102     return 0UL;
    103 
     58         CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
    10459         break;
    10560      case 1 :
     
    11469   return 1UL;
    11570}
    116 
    117 
    118 static void APIENTRY cleanup(ULONG ulReason)
    119 {
    120    _ctordtorTerm();
    121    CRT_term();
    122    DosExitList(EXLST_EXIT, cleanup);
    123    return ;
    124 }
Note: See TracChangeset for help on using the changeset viewer.