Merge commit 'refs/pull/24298/head' of github.com:wxWidgets/wxWidgets
Build fixes for wxQt/Android. Also allows wxLogDebug to work on Android. See #24298.
This commit is contained in:
commit
4b4f0d3d86
4 changed files with 26 additions and 6 deletions
|
|
@ -134,6 +134,13 @@ if(WXQT)
|
||||||
list(APPEND wxTOOLKIT_DEFINITIONS ${Qt5${QT_COMPONENT}_COMPILE_DEFINITIONS})
|
list(APPEND wxTOOLKIT_DEFINITIONS ${Qt5${QT_COMPONENT}_COMPILE_DEFINITIONS})
|
||||||
endforeach()
|
endforeach()
|
||||||
set(wxTOOLKIT_VERSION ${Qt5Core_VERSION})
|
set(wxTOOLKIT_VERSION ${Qt5Core_VERSION})
|
||||||
|
|
||||||
|
if(ANDROID)
|
||||||
|
# A hack to remove _${ANDROID_ABI} that Qt5AndroidSupport.cmake added
|
||||||
|
# which breaks wx-config.
|
||||||
|
set(CMAKE_SHARED_LIBRARY_SUFFIX_C ${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||||
|
set(CMAKE_SHARED_LIBRARY_SUFFIX_CXX ${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
|
|
|
||||||
|
|
@ -160,9 +160,9 @@
|
||||||
|
|
||||||
#ifdef __ANDROID__ // these functions are broken on android
|
#ifdef __ANDROID__ // these functions are broken on android
|
||||||
|
|
||||||
extern double android_wcstod(const wchar_t *nptr, wchar_t **endptr);
|
WXDLLIMPEXP_BASE double android_wcstod(const wchar_t *nptr, wchar_t **endptr);
|
||||||
extern long android_wcstol(const wchar_t *nptr, wchar_t **endptr, int base);
|
WXDLLIMPEXP_BASE long android_wcstol(const wchar_t *nptr, wchar_t **endptr, int base);
|
||||||
extern unsigned long android_wcstoul(const wchar_t *nptr, wchar_t **endptr, int base);
|
WXDLLIMPEXP_BASE unsigned long android_wcstoul(const wchar_t *nptr, wchar_t **endptr, int base);
|
||||||
|
|
||||||
#define wxCRT_StrtodW android_wcstod
|
#define wxCRT_StrtodW android_wcstod
|
||||||
#define wxCRT_StrtolW android_wcstol
|
#define wxCRT_StrtolW android_wcstol
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,10 @@
|
||||||
#include "wx/msw/private.h"
|
#include "wx/msw/private.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__ANDROID__)
|
||||||
|
#include <android/log.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
// implementation
|
// implementation
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
@ -143,8 +147,13 @@ wxMessageOutputStderr::wxMessageOutputStderr(FILE *fp, const wxMBConv& conv)
|
||||||
void wxMessageOutputStderr::Output(const wxString& str)
|
void wxMessageOutputStderr::Output(const wxString& str)
|
||||||
{
|
{
|
||||||
const wxCharBuffer& buf = PrepareForOutput(str);
|
const wxCharBuffer& buf = PrepareForOutput(str);
|
||||||
|
|
||||||
|
#if defined(__ANDROID__)
|
||||||
|
__android_log_write(ANDROID_LOG_INFO, "wxWidgets", buf.data());
|
||||||
|
#else
|
||||||
fwrite(buf, buf.length(), 1, m_fp);
|
fwrite(buf, buf.length(), 1, m_fp);
|
||||||
fflush(m_fp);
|
fflush(m_fp);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
@ -158,6 +167,10 @@ void wxMessageOutputDebug::Output(const wxString& str)
|
||||||
out.Replace(wxT("\t"), wxT(" "));
|
out.Replace(wxT("\t"), wxT(" "));
|
||||||
out.Replace(wxT("\n"), wxT("\r\n"));
|
out.Replace(wxT("\n"), wxT("\r\n"));
|
||||||
::OutputDebugString(out.t_str());
|
::OutputDebugString(out.t_str());
|
||||||
|
#elif defined(__ANDROID__)
|
||||||
|
const wxCharBuffer& buf = PrepareForOutput(str);
|
||||||
|
|
||||||
|
__android_log_write(ANDROID_LOG_DEBUG, "wxWidgets", buf.data());
|
||||||
#else
|
#else
|
||||||
// TODO: use native debug output function for the other ports too
|
// TODO: use native debug output function for the other ports too
|
||||||
wxMessageOutputStderr::Output(str);
|
wxMessageOutputStderr::Output(str);
|
||||||
|
|
|
||||||
|
|
@ -1219,21 +1219,21 @@ int wxVsscanf(const wxCStrData& str, const wchar_t *format, va_list ap)
|
||||||
} \
|
} \
|
||||||
return d;
|
return d;
|
||||||
|
|
||||||
long android_wcstol(const wchar_t *nptr, wchar_t **endptr, int base)
|
WXDLLEXPORT long android_wcstol(const wchar_t *nptr, wchar_t **endptr, int base)
|
||||||
{
|
{
|
||||||
ANDROID_WCSTO_START
|
ANDROID_WCSTO_START
|
||||||
long d = strtol(dst, &dstendp, base);
|
long d = strtol(dst, &dstendp, base);
|
||||||
ANDROID_WCSTO_END
|
ANDROID_WCSTO_END
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long android_wcstoul(const wchar_t *nptr, wchar_t **endptr, int base)
|
WXDLLEXPORT unsigned long android_wcstoul(const wchar_t *nptr, wchar_t **endptr, int base)
|
||||||
{
|
{
|
||||||
ANDROID_WCSTO_START
|
ANDROID_WCSTO_START
|
||||||
unsigned long d = strtoul(dst, &dstendp, base);
|
unsigned long d = strtoul(dst, &dstendp, base);
|
||||||
ANDROID_WCSTO_END
|
ANDROID_WCSTO_END
|
||||||
}
|
}
|
||||||
|
|
||||||
double android_wcstod(const wchar_t *nptr, wchar_t **endptr)
|
WXDLLEXPORT double android_wcstod(const wchar_t *nptr, wchar_t **endptr)
|
||||||
{
|
{
|
||||||
ANDROID_WCSTO_START
|
ANDROID_WCSTO_START
|
||||||
double d = strtod(dst, &dstendp);
|
double d = strtod(dst, &dstendp);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue