Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: ports/ruby-ppapi/main.c

Issue 1417223003: Switch from using 'nacl_main' to 'main' entry point (Closed) Base URL: https://chromium.googlesource.com/external/naclports.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ports/ruby-ppapi/build.sh ('k') | ports/samba/build.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2013 The Native Client Authors. All rights reserved. 1 /* Copyright (c) 2013 The Native Client Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. */ 3 * found in the LICENSE file. */
4 4
5 #undef RUBY_EXPORT 5 #undef RUBY_EXPORT
6 #include <ruby.h> 6 #include <ruby.h>
7 #include <spawn.h> 7 #include <spawn.h>
8 #include <stdio.h> 8 #include <stdio.h>
9 9
10 #include "nacl_main.h" 10 #include "nacl_main.h"
11 11
12 #ifdef __x86_64__ 12 #ifdef __x86_64__
13 #define NACL_ARCH "x86_64" 13 #define NACL_ARCH "x86_64"
14 #elif defined __i386__ 14 #elif defined __i386__
15 /* 15 /*
16 * Use __i386__ rather then __i686__ since the latter is not defined 16 * Use __i386__ rather then __i686__ since the latter is not defined
17 * by i686-nacl-clang. 17 * by i686-nacl-clang.
18 */ 18 */
19 #define NACL_ARCH "x86_32" 19 #define NACL_ARCH "x86_32"
20 #elif defined __arm__ 20 #elif defined __arm__
21 #define NACL_ARCH "arm" 21 #define NACL_ARCH "arm"
22 #elif defined __pnacl__ 22 #elif defined __pnacl__
23 #define NACL_ARCH "pnacl" 23 #define NACL_ARCH "pnacl"
24 #else 24 #else
25 #error "unknown arch" 25 #error "unknown arch"
26 #endif 26 #endif
27 27
28 #define DATA_ARCHIVE "rbdata-" NACL_ARCH ".tar" 28 #define DATA_ARCHIVE "rbdata-" NACL_ARCH ".tar"
29 29
30 int nacl_main(int argc, char** argv) { 30 int main(int argc, char** argv) {
31 if (nacl_startup_untar(argv[0], DATA_ARCHIVE, "/")) 31 if (nacl_startup_untar(argv[0], DATA_ARCHIVE, "/"))
32 return -1; 32 return -1;
33 33
34 if (argc == 2 && !strcmp(argv[1], "/bin/irb")) 34 if (argc == 2 && !strcmp(argv[1], "/bin/irb"))
35 fprintf(stderr, "Launching irb ...\n"); 35 fprintf(stderr, "Launching irb ...\n");
36 ruby_sysinit(&argc, &argv); 36 ruby_sysinit(&argc, &argv);
37 { 37 {
38 RUBY_INIT_STACK; 38 RUBY_INIT_STACK;
39 ruby_init(); 39 ruby_init();
40 return ruby_run_node(ruby_options(argc, argv)); 40 return ruby_run_node(ruby_options(argc, argv));
41 } 41 }
42 } 42 }
OLDNEW
« no previous file with comments | « ports/ruby-ppapi/build.sh ('k') | ports/samba/build.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698