toolkit/library/nsDllMain.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/library/nsDllMain.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,43 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 + 
     1.9 +#include <windows.h>
    1.10 +#include "nsToolkit.h"
    1.11 +#include "mozilla/Assertions.h"
    1.12 +#include "mozilla/WindowsVersion.h"
    1.13 +
    1.14 +#if defined(__GNUC__)
    1.15 +// If DllMain gets name mangled, it won't be seen.
    1.16 +extern "C" {
    1.17 +#endif
    1.18 +
    1.19 +BOOL APIENTRY DllMain(  
    1.20 +                      HINSTANCE hModule, 
    1.21 +                      DWORD reason, 
    1.22 +                      LPVOID lpReserved )
    1.23 +{
    1.24 +    switch( reason ) {
    1.25 +        case DLL_PROCESS_ATTACH:
    1.26 +            nsToolkit::Startup((HINSTANCE)hModule);
    1.27 +            break;
    1.28 +
    1.29 +        case DLL_THREAD_ATTACH:
    1.30 +            break;
    1.31 +    
    1.32 +        case DLL_THREAD_DETACH:
    1.33 +            break;
    1.34 +    
    1.35 +        case DLL_PROCESS_DETACH:
    1.36 +            nsToolkit::Shutdown();
    1.37 +            break;
    1.38 +
    1.39 +    }
    1.40 +
    1.41 +    return TRUE;
    1.42 +}
    1.43 +
    1.44 +#if defined(__GNUC__)
    1.45 +} // extern "C"
    1.46 +#endif

mercurial