Skip to content

Commit 111795a

Browse files
Fix android build
1 parent 8aff386 commit 111795a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

native/dispatch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
#define DEFAULT_LOAD_OPTS (RTLD_LAZY|RTLD_GLOBAL)
7272
#define LOAD_LIBRARY(NAME,OPTS) dlopen(NAME, OPTS)
7373
static inline char * LOAD_ERROR() {
74-
char* message = dlerror();
74+
const char* message = dlerror();
7575
char* buf = (char*) malloc(strlen(message) + 1 /* null */);
7676
strcpy(buf, message);
7777
return buf;

native/testlib.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,10 +911,11 @@ addVarArgs(const char *fmt, ...) {
911911
EXPORT int32_t
912912
addSeveralFixedArgsAndVarArgs(int a, int b, int c, int d, int n_varargs, ...) {
913913
va_list ap;
914+
int i;
914915
int32_t sum = a + b + c + d;
915916
va_start(ap, n_varargs);
916917

917-
for (int i = 0; i < n_varargs; i++) {
918+
for (i = 0; i < n_varargs; i++) {
918919
sum += va_arg(ap, int32_t);
919920
}
920921
va_end(ap);
@@ -1108,8 +1109,9 @@ EXPORT size_t copyString(char* input, char* output) {
11081109
* responsible to allocate a correctly sized buffer.
11091110
*/
11101111
EXPORT size_t copyStringArray(char** input, char* output) {
1112+
int i;
11111113
size_t len = 0;
1112-
for(int i = 0;; i++) {
1114+
for(i = 0;; i++) {
11131115
char* currInput = input[i];
11141116
if(currInput == NULL) {
11151117
break;

0 commit comments

Comments
 (0)