Home | History | Annotate | Download | only in app
      1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "chrome/app/chrome_main_delegate.h"
      6 
      7 #include "content/public/app/content_main.h"
      8 
      9 #if defined(OS_WIN)
     10 #define DLLEXPORT __declspec(dllexport)
     11 
     12 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling.
     13 extern "C" {
     14 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance,
     15                                  sandbox::SandboxInterfaceInfo* sandbox_info);
     16 }
     17 #elif defined(OS_POSIX)
     18 extern "C" {
     19 __attribute__((visibility("default")))
     20 int ChromeMain(int argc, const char** argv);
     21 }
     22 #endif
     23 
     24 #if defined(OS_WIN)
     25 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance,
     26                                  sandbox::SandboxInterfaceInfo* sandbox_info) {
     27   ChromeMainDelegate chrome_main_delegate;
     28   return content::ContentMain(instance, sandbox_info, &chrome_main_delegate);
     29 #elif defined(OS_POSIX)
     30 int ChromeMain(int argc, const char** argv) {
     31   ChromeMainDelegate chrome_main_delegate;
     32   return content::ContentMain(argc, argv, &chrome_main_delegate);
     33 #endif
     34 }
     35