Backed out changeset bcbab342eed8 (bug 1889658) for causing wpt reftest failures...
[gecko.git] / toolkit / library / nsDllMain.cpp
blob396005b18451faf4d4fba74c167eefd03f315558
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include <windows.h>
7 #include "nsToolkit.h"
8 #include "mozilla/Assertions.h"
9 #include "mozilla/WindowsVersion.h"
11 #if defined(__GNUC__)
12 // If DllMain gets name mangled, it won't be seen.
13 extern "C" {
14 #endif
16 BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD reason, LPVOID lpReserved) {
17 switch (reason) {
18 case DLL_PROCESS_ATTACH:
19 nsToolkit::Startup((HINSTANCE)hModule);
20 break;
22 case DLL_THREAD_ATTACH:
23 break;
25 case DLL_THREAD_DETACH:
26 break;
28 case DLL_PROCESS_DETACH:
29 nsToolkit::Shutdown();
30 break;
33 return TRUE;
36 #if defined(__GNUC__)
37 } // extern "C"
38 #endif