Add minimal support for building non-GUI parts of wxWidgets for Android.

Recognize __ANDROID__ in wx/platform.h and include the appropriate headers
from wx/android.

Also fix a couple of compilation errors (in filename.cpp) and warnings (in
event.h) which only appear when building for Android.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70703 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-02-26 20:24:25 +00:00
parent 1eff60811f
commit 1b4bff8262
7 changed files with 1949 additions and 6 deletions
File diff suppressed because it is too large Load Diff
+56
View File
@@ -0,0 +1,56 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/android/config_android.h
// Purpose: configurations for Android builds
// Author: Zsolt Bakcsi
// Modified by:
// Created: 2011-12-02
// RCS-ID:
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// Please note that most of these settings are based on config_xcode.h and
// 'fine-tuned' on a trial-and-error basis. This means, no in-depth analysis
// of Android docs / source was done.
#define wxUSE_UNIX 1
#define __UNIX__ 1
#define HAVE_NANOSLEEP
#define HAVE_FCNTL 1
#define HAVE_GCC_ATOMIC_BUILTINS
#define HAVE_GETHOSTBYNAME 1
#define HAVE_GETSERVBYNAME 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GMTIME_R 1
#define HAVE_INET_ADDR 1
#define HAVE_INET_ATON 1
#define HAVE_LOCALTIME_R 1
#define HAVE_PTHREAD_MUTEXATTR_T 1
#define HAVE_PTHREAD_MUTEXATTR_SETTYPE_DECL 1
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
#define HAVE_THREAD_PRIORITY_FUNCTIONS 1
#define HAVE_SSIZE_T 1
#define HAVE_STRCASECMP_IN_STRING_H 1
#define HAVE_WPRINTF 1
#define SIZEOF_INT 4
#define SIZEOF_LONG 4
#define SIZEOF_LONG_LONG 8
#define SIZEOF_SIZE_T 4
#define SIZEOF_VOID_P 4
#define SIZEOF_WCHAR_T 4
#define wxHAVE_PTHREAD_CLEANUP 1
#define wxNO_WOSTREAM
#define wxSIZE_T_IS_UINT 1
#define wxWCHAR_T_IS_REAL_TYPE 1
#define wxTYPE_SA_HANDLER int
#define wxUSE_SELECT_DISPATCHER 1
#ifdef HAVE_PTHREAD_CANCEL
// Android doesn't support pthread_cancel().
#undef HAVE_PTHREAD_CANCEL
#endif
File diff suppressed because it is too large Load Diff
+2
View File
@@ -1219,6 +1219,8 @@
# include "wx/motif/chkconf.h"
#elif defined(__WXX11__)
# include "wx/x11/chkconf.h"
#elif defined(__WXANDROID__)
# include "wx/android/chkconf.h"
#endif
/*
+6 -3
View File
@@ -225,10 +225,13 @@ public:
const wxObjectEventFunctor &other =
static_cast< const wxObjectEventFunctor & >( functor );
// FIXME-VC6: amazing but true: replacing "method == NULL" here
// with "!method" makes VC6 crash with an ICE in DLL build (only!)
// FIXME-VC6: amazing but true: replacing "m_method == 0" here
// with "!m_method" makes VC6 crash with an ICE in DLL build (only!)
// Also notice that using "NULL" instead of "0" results in warnings
// about "using NULL in arithmetics" from arm-linux-androideabi-g++
// 4.4.3 used for wxAndroid build.
return ( m_method == other.m_method || other.m_method == NULL ) &&
return ( m_method == other.m_method || other.m_method == 0 ) &&
( m_handler == other.m_handler || other.m_handler == NULL );
}
else
+5
View File
@@ -149,6 +149,11 @@
# define __WXHANDHELD__
#endif
#ifdef __ANDROID__
# define __WXANDROID__
# include "wx/android/config_android.h"
#endif
/*
Include wx/setup.h for the Unix platform defines generated by configure and
the library compilation options
+5 -3
View File
@@ -2666,12 +2666,14 @@ bool wxFileName::GetTimes(wxDateTime *dtAccess,
wxStructStat stBuf;
if ( wxStat( GetFullPath(), &stBuf) == 0 )
{
// Android defines st_*time fields as unsigned long, but time_t as long,
// hence the static_casts.
if ( dtAccess )
dtAccess->Set(stBuf.st_atime);
dtAccess->Set(static_cast<time_t>(stBuf.st_atime));
if ( dtMod )
dtMod->Set(stBuf.st_mtime);
dtMod->Set(static_cast<time_t>(stBuf.st_mtime));
if ( dtCreate )
dtCreate->Set(stBuf.st_ctime);
dtCreate->Set(static_cast<time_t>(stBuf.st_ctime));
return true;
}