Skip to content

Commit

Permalink
Fix #298: lib expects existence of stpcpy, so fake it in executable.
Browse files Browse the repository at this point in the history
(Because the library is built at API >= 21 and the executable isn't.)
  • Loading branch information
chrisboyle committed Jul 27, 2015
1 parent 06c6e45 commit 07475df
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions .idea/dictionaries/cmb.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ android.applicationVariants.all{ variant ->
abiParam,
'NDK_LOG=1',
'NDK_DEBUG=' + (variant.ndkCompile.debuggable ? '1' : '0')]
// You must remove the fake stpcpy implementation in android-gen.c when increasing APP_PLATFORM to >= 21
exec {
commandLine common + [
'APP_PLATFORM=android-9', // 9 is earliest for x86 + mips
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/jni/android-gen.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#ifdef EXECUTABLE
#include <stdio.h>
#include <string.h>
#include "puzzles.h"

#define USAGE "Usage: puzzles-gen gamename [params | --seed seed | --desc desc]\n"

/* https://github.com/chrisboyle/sgtpuzzles/issues/298 */
char *
stpcpy(char *dst, char const *src)
{
size_t src_len = strlen(src);
return memcpy(dst, src, src_len) + src_len;
}

struct frontend {
midend *me;
};
Expand Down

0 comments on commit 07475df

Please sign in to comment.