Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Check for __ANDROID__ not ANDROID
The latter doesn't appear to be set by the NDK.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Mar 11, 2013
1 parent 5533e48 commit 391ea5d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion android/Makefile
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions main.c
Expand Up @@ -29,7 +29,7 @@
#endif

#include <stdio.h>
#ifdef ANDROID
#ifdef __ANDROID__
#include <android/log.h>
#else
#include <syslog.h>
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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] = {
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion openconnect-internal.h
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion openssl.c
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion ssl.c
Expand Up @@ -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>
Expand Down

0 comments on commit 391ea5d

Please sign in to comment.