Index: native_client_sdk/src/examples/dlopen/eightball.cc |
=================================================================== |
--- native_client_sdk/src/examples/dlopen/eightball.cc (revision 0) |
+++ native_client_sdk/src/examples/dlopen/eightball.cc (revision 0) |
@@ -0,0 +1,22 @@ |
+#include <stdlib.h> |
Brad Chen
2012/01/28 01:00:52
Copyright headers on all source files.
|
+#include <stdio.h> |
+ |
+extern "C" |
+{ |
+__attribute__((visibility("default")))const char *Magic8Ball() { |
Brad Chen
2012/01/28 01:00:52
If you need to keep the __attribute__ stuff, maybe
noelallen1
2012/01/31 21:03:21
Done.
|
+ const int NSIDES = 8; |
+ const char* answer[] = { |
+ "YES", |
+ "NO", |
+ "MAYBE", |
+ "MAYBE NOT", |
+ "DEFINITELY", |
+ "ASK ME TOMORROW", |
+ "PARTLY CLOUDY", |
+ "42", |
+ }; |
+ |
+ return answer[rand() % NSIDES]; |
+} |
+} |
Brad Chen
2012/01/28 01:00:52
Not worth using the {} for extern "C" if there is
noelallen1
2012/01/31 21:03:21
Done.
|
+ |
Property changes on: native_client_sdk/src/examples/dlopen/eightball.cc |
___________________________________________________________________ |
Added: svn:eol-style |
+ LF |