ndk_patches: Use __inline__ for custom functions

This avoids warnings due to unused functions when building.
This commit is contained in:
Fredrik Fornwall 2016-09-22 14:43:21 -04:00
parent a1b245c64e
commit 5c36f4e054
2 changed files with 8 additions and 8 deletions

View File

@ -37,7 +37,7 @@ diff -u -r /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm/usr/incl
+#define __sferror(p) (((p)->_flags & __SERR) != 0)
+
+/* Used by perl, fish, and others */
+static char* ctermid(char* s) {
+static __inline__ char* ctermid(char* s) {
+ if (s == 0) return (char*) "/dev/tty";
+ strcpy(s, "/dev/tty");
+ return s;
@ -55,7 +55,7 @@ diff -u -r /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm/usr/incl
+extern int open(const char*, int, ...);
+extern pid_t getpid();
+extern int unlink(const char*);
+static FILE* tmpfile() {
+static __inline__ FILE* tmpfile() {
+ int p = getpid();
+ char* path;
+ int i;

View File

@ -15,14 +15,14 @@ diff -Nur /Users/fornwall/lib/android-ndk/platforms/android-18/arch-arm/usr/incl
extern void vsyslog_r(int, struct syslog_data *, const char *, va_list);
+extern /*const*/ char* __progname;
+static void android_polyfill_openlog(const char* a, int b, int c) {
+static __inline__ void android_polyfill_openlog(const char* a, int b, int c) {
+ (void) a;
+ (void) b;
+ (void) c;
+}
+static void android_polyfill_closelog() {}
+static __inline__ void android_polyfill_closelog() {}
+
+static void android_polyfill_vsyslog(int syslog_priority, char const* format, va_list ap)
+static __inline__ void android_polyfill_vsyslog(int syslog_priority, char const* format, va_list ap)
+{
+ android_LogPriority a = ANDROID_LOG_FATAL;
+ switch (syslog_priority) {
@ -41,7 +41,7 @@ diff -Nur /Users/fornwall/lib/android-ndk/platforms/android-18/arch-arm/usr/incl
+ free(syslog_text);
+}
+
+static void android_polyfill_syslog(int priority, const char* format, ...)
+static __inline__ void android_polyfill_syslog(int priority, const char* format, ...)
+{
+ va_list myargs;
+ va_start(myargs, format);
@ -49,7 +49,7 @@ diff -Nur /Users/fornwall/lib/android-ndk/platforms/android-18/arch-arm/usr/incl
+ va_end(myargs);
+}
+
+static void android_polyfill_syslog_r(int syslog_priority, struct syslog_data* d, const char* format, ...)
+static __inline__ void android_polyfill_syslog_r(int syslog_priority, void* d, const char* format, ...)
+{
+ (void) d;
+ va_list myargs;
@ -58,7 +58,7 @@ diff -Nur /Users/fornwall/lib/android-ndk/platforms/android-18/arch-arm/usr/incl
+ va_end(myargs);
+}
+
+static void android_polyfill_vsyslog_r(int syslog_priority, struct syslog_data* d, const char* fmt, va_list ap)
+static __inline__ void android_polyfill_vsyslog_r(int syslog_priority, void* d, const char* fmt, va_list ap)
+{
+ (void) d;
+ android_polyfill_vsyslog(syslog_priority, fmt, ap);