Changeset 365


Ignore:
Timestamp:
May 10, 2012, 11:43:17 PM (13 years ago)
Author:
dmik
Message:

icedtea-web: Hook up DLL initialization to call static C/C++ initializers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc

    r364 r365  
    3939#ifdef __OS2__
    4040// OS/2 includes.
    41 #define INCL_PM
     41#define INCL_DOSPROCESS
     42#define INCL_DOSERRORS
     43#define INCL_WINDIALOG
    4244#include <os2.h>
     45#include <emx/startup.h>
    4346#endif
    4447
     
    25302533        return new IcedTeaScriptablePluginObject(npp);
    25312534}
     2535
     2536#ifdef __OS2__
     2537
     2538// Make sure static initializers in the plugin DLL are called
     2539
     2540static APIENTRY void cleanup(ULONG ulReason)
     2541{
     2542    __ctordtorTerm();
     2543    _CRT_term();
     2544    DosExitList(EXLST_EXIT, cleanup);
     2545}
     2546
     2547unsigned long _System _DLL_InitTerm(unsigned long hModule,
     2548                                    unsigned long ulFlag)
     2549{
     2550    APIRET arc;
     2551
     2552    if (ulFlag == 0)
     2553    {
     2554        arc = DosExitList (EXLST_ADD, cleanup);
     2555        if (arc != NO_ERROR)
     2556            return 0;
     2557
     2558        if (_CRT_init() != 0) // failure?
     2559            return 0;
     2560        __ctordtorInit();
     2561    }
     2562
     2563    return 1;
     2564}
     2565
     2566#endif /* __OS2__ */
Note: See TracChangeset for help on using the changeset viewer.