Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / native_client_sdk / src / libraries / ppapi_simple / ps_main.c
blob39235749447f11c0e39cbb08dc36a93e27d59232
1 /* Copyright 2015 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. */
5 #include "ppapi_simple/ps_main.h"
7 #ifdef __native_client__
8 #include <irt.h>
9 #include <irt_ppapi.h>
10 #endif
12 #include <stdio.h>
14 #include "nacl_io/nacl_io.h"
15 #include "ppapi_simple/ps_instance.h"
17 FORCE_LINK_THIS(ps_main)
19 int PpapiPluginMain();
21 /**
22 * main entry point for ppapi_simple applications. This differs from the
23 * regular ppapi main entry point in that it will fall back to running
24 * the user's main code in the case that the PPAPI hooks are not found.
25 * This allows ppapi_simple binary to run within chrome (with PPAPI present)
26 * and also under sel_ldr (no PPAPI).
28 #ifdef __native_client__
29 int __nacl_main(int argc, char* argv[]) {
30 struct nacl_irt_ppapihook hooks;
31 if (nacl_interface_query(NACL_IRT_PPAPIHOOK_v0_1, &hooks, sizeof(hooks)) ==
32 sizeof(hooks)) {
33 return PpapiPluginMain();
35 #else
36 int main(int argc, char* argv[]) {
37 #endif
38 // By default, or if not running in the browser we simply run the main
39 // entry point directly, on the main thread.
40 return PSUserMainGet()(argc, argv);