|
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
|
2 /* vim: set ts=8 sts=4 et sw=4 tw=99: */ |
|
3 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 /* XPConnect JavaScript interactive shell. */ |
|
8 |
|
9 #include <stdio.h> |
|
10 |
|
11 #include "mozilla/WindowsDllBlocklist.h" |
|
12 |
|
13 #include "nsXULAppAPI.h" |
|
14 #ifdef XP_MACOSX |
|
15 #include "xpcshellMacUtils.h" |
|
16 #endif |
|
17 #ifdef XP_WIN |
|
18 #include <windows.h> |
|
19 #include <shlobj.h> |
|
20 |
|
21 // we want a wmain entry point |
|
22 #define XRE_DONT_PROTECT_DLL_LOAD |
|
23 #define XRE_WANT_ENVIRON |
|
24 #include "nsWindowsWMain.cpp" |
|
25 #endif |
|
26 |
|
27 int |
|
28 main(int argc, char** argv, char** envp) |
|
29 { |
|
30 #ifdef XP_MACOSX |
|
31 InitAutoreleasePool(); |
|
32 #endif |
|
33 |
|
34 // unbuffer stdout so that output is in the correct order; note that stderr |
|
35 // is unbuffered by default |
|
36 setbuf(stdout, 0); |
|
37 |
|
38 #ifdef HAS_DLL_BLOCKLIST |
|
39 DllBlocklist_Initialize(); |
|
40 #endif |
|
41 |
|
42 int result = XRE_XPCShellMain(argc, argv, envp); |
|
43 |
|
44 #ifdef XP_MACOSX |
|
45 FinishAutoreleasePool(); |
|
46 #endif |
|
47 |
|
48 return result; |
|
49 } |