]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Check for __ANDROID__ not ANDROID
authorDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 11 Mar 2013 14:08:11 +0000 (14:08 +0000)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 11 Mar 2013 14:08:14 +0000 (14:08 +0000)
The latter doesn't appear to be set by the NDK.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
android/Makefile
main.c
openconnect-internal.h
openssl.c
ssl.c

index 633f2e73b22f0905eba1138fe53ee12887363500..c1041bce6009fbe7fb877fc23ca542c7c1664c74 100644 (file)
@@ -247,7 +247,7 @@ OPENCONNECT_BUILD := $(TRIPLET)/openconnect
 $(OPENCONNECT_BUILD)/Makefile: $(GNUTLS_DEPS) $(LIBXML_DEPS) ../configure
        mkdir -p $(OPENCONNECT_BUILD)
        cd $(OPENCONNECT_BUILD) && ../../../configure $(CONFIGURE_ARGS) \
-       CFLAGS="--sysroot=$(NDK_SYSROOT) -DNO_BROKEN_DTLS_CHECK -DANDROID" \
+       CFLAGS="--sysroot=$(NDK_SYSROOT) -DNO_BROKEN_DTLS_CHECK" \
        GNUTLS_LIBS="$(shell PKG_CONFIG_LIBDIR=$(OC_SYSROOT)/lib/pkgconfig pkg-config --static --libs gnutls)" --enable-shared
 
 openconnect: $(OPENCONNECT_BUILD)/Makefile
diff --git a/main.c b/main.c
index dfb7d3be234e45224a68cce1057ca8542754ac81..c5ebd57aa9b38ce119e08f59d4b184551139d6ae 100644 (file)
--- a/main.c
+++ b/main.c
@@ -29,7 +29,7 @@
 #endif
 
 #include <stdio.h>
-#ifdef ANDROID
+#ifdef __ANDROID__
 #include <android/log.h>
 #else
 #include <syslog.h>
@@ -756,7 +756,7 @@ int main(int argc, char **argv)
                exit(1);
 
        if (use_syslog) {
-#ifndef ANDROID
+#ifndef __ANDROID__
                openlog("openconnect", LOG_PID, LOG_DAEMON);
 #endif
                vpninfo->progress = syslog_progress;
@@ -937,7 +937,7 @@ void write_progress(void *_vpninfo, int level, const char *fmt, ...)
        }
 }
 
-#ifdef ANDROID
+#ifdef __ANDROID__
 void syslog_progress(void *_vpninfo, int level, const char *fmt, ...)
 {
        static int l[4] = {
@@ -959,7 +959,7 @@ void syslog_progress(void *_vpninfo, int level, const char *fmt, ...)
                va_end(args2);
        }
 }
-#else /* !ANDROID */
+#else /* !__ANDROID__ */
 void syslog_progress(void *_vpninfo, int level, const char *fmt, ...)
 {
        int priority = level ? LOG_INFO : LOG_NOTICE;
index 3355c3d83b0ed7598876136f9d4eee3de6b18915..8ec2dc5252d62b9fd6452ed15c24902da148a683 100644 (file)
@@ -385,7 +385,7 @@ int  __attribute__ ((format (printf, 2, 3)))
     openconnect_SSL_printf(struct openconnect_info *vpninfo, const char *fmt, ...);
 int openconnect_print_err_cb(const char *str, size_t len, void *ptr);
 #define openconnect_report_ssl_errors(v) ERR_print_errors_cb(openconnect_print_err_cb, (v))
-#if defined(FAKE_ANDROID_KEYSTORE) || defined(ANDROID)
+#if defined(FAKE_ANDROID_KEYSTORE) || defined(__ANDROID__)
 #define ANDROID_KEYSTORE
 #endif
 #ifdef ANDROID_KEYSTORE
index 741f5517b11a48b4f0f134b2f4e45238d574c799..5e2a94ea7693e1881f975dc769a42108ef55ab97 100644 (file)
--- a/openssl.c
+++ b/openssl.c
@@ -762,7 +762,7 @@ static int load_certificate(struct openconnect_info *vpninfo)
                }
                return 0;
        }
-#endif /* ANDROID */
+#endif /* ANDROID_KEYSTORE */
 
        if (vpninfo->cert_type == CERT_TYPE_UNKNOWN) {
                FILE *f = fopen(vpninfo->sslkey, "r");
diff --git a/ssl.c b/ssl.c
index 5d40a64464c235aa7482ed7bcf0ca947875ecd3f..7a0860938777965b981da9da5359cd65d0f02270 100644 (file)
--- a/ssl.c
+++ b/ssl.c
@@ -35,7 +35,7 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <stdarg.h>
-#if defined(__linux__) || defined(ANDROID)
+#if defined(__linux__) || defined(__ANDROID__)
 #include <sys/vfs.h>
 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__APPLE__)
 #include <sys/param.h>