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__
14 #include "nacl_io/nacl_io.h"
15 #include "ppapi_simple/ps_instance.h"
17 FORCE_LINK_THIS(ps_main
)
19 int PpapiPluginMain();
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
)) ==
33 return PpapiPluginMain();
36 int main(int argc
, char* argv
[]) {
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
);