js/xpconnect/shell/xpcshell.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/xpconnect/shell/xpcshell.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,49 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* vim: set ts=8 sts=4 et sw=4 tw=99: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +/* XPConnect JavaScript interactive shell. */
    1.11 +
    1.12 +#include <stdio.h>
    1.13 +
    1.14 +#include "mozilla/WindowsDllBlocklist.h"
    1.15 +
    1.16 +#include "nsXULAppAPI.h"
    1.17 +#ifdef XP_MACOSX
    1.18 +#include "xpcshellMacUtils.h"
    1.19 +#endif
    1.20 +#ifdef XP_WIN
    1.21 +#include <windows.h>
    1.22 +#include <shlobj.h>
    1.23 +
    1.24 +// we want a wmain entry point
    1.25 +#define XRE_DONT_PROTECT_DLL_LOAD
    1.26 +#define XRE_WANT_ENVIRON
    1.27 +#include "nsWindowsWMain.cpp"
    1.28 +#endif
    1.29 +
    1.30 +int
    1.31 +main(int argc, char** argv, char** envp)
    1.32 +{
    1.33 +#ifdef XP_MACOSX
    1.34 +    InitAutoreleasePool();
    1.35 +#endif
    1.36 +
    1.37 +    // unbuffer stdout so that output is in the correct order; note that stderr
    1.38 +    // is unbuffered by default
    1.39 +    setbuf(stdout, 0);
    1.40 +
    1.41 +#ifdef HAS_DLL_BLOCKLIST
    1.42 +    DllBlocklist_Initialize();
    1.43 +#endif
    1.44 +
    1.45 +    int result = XRE_XPCShellMain(argc, argv, envp);
    1.46 +
    1.47 +#ifdef XP_MACOSX
    1.48 +    FinishAutoreleasePool();
    1.49 +#endif
    1.50 +
    1.51 +    return result;
    1.52 +}

mercurial