forked from facebook/yoga
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move JNI_OnLoad to separate file which registers both fbjni and jni m…
…ethods Summary: Move JNI_ONLoad to a separate file so that both fbjni native methods and vanillla jni native methods can be initialized correctly Reviewed By: amir-shalem Differential Revision: D17840166 fbshipit-source-id: 045df0df7a95bc331cbbefb3a118a349f3029465
- Loading branch information
1 parent
aa2610c
commit 2e321fc
Showing
3 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the LICENSE | ||
* file in the root directory of this source tree. | ||
*/ | ||
#include "yogajni.h" | ||
#include "YGJNIVanilla.h" | ||
#include <fbjni/fbjni.h> | ||
#include "common.h" | ||
|
||
using namespace facebook::jni; | ||
using namespace facebook::yoga; | ||
|
||
jint JNI_OnLoad(JavaVM* vm, void*) { | ||
jint ret = YGJNI::registerNativeMethods(vm); | ||
|
||
JNIEnv* env; | ||
vanillajni::ensureInitialized(&env, vm); | ||
YGJNIVanilla::registerNatives(env); | ||
return ret; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the LICENSE | ||
* file in the root directory of this source tree. | ||
*/ | ||
#include <fbjni/fbjni.h> | ||
|
||
namespace YGJNI { | ||
jint registerNativeMethods(JavaVM* vm); | ||
}; |