config_host/config_features.h.in | 3 +-- configure.ac | 2 +- sal/osl/unx/process_impl.cxx | 8 ++------ sal/rtl/bootstrap.cxx | 11 +---------- 4 files changed, 5 insertions(+), 19 deletions(-)
New commits: commit fe8ef98e2c1611a72bd2840cd08dc101f25b1cd3 Author: Tor Lillqvist <[email protected]> Date: Wed Oct 9 12:15:06 2013 +0300 Use assertions to ensure proper use of the osl command line arg API Stephan says: I don't buy that argument of making things less fragile; IMO it's that "defensive programming" approach gone wrong, where you add complexity to mitigate a problem's effects in one place, instead of fixing the problem itself in the real place. [...] The better robustification is probably to turn the OSL_TRACE in osl_getCommandArgCount (sal/osl/unx/process_impl.cxx) into something stronger like SAL_WARN, assert, or std::abort Change-Id: I3ba6684b4921eb67c2f4534e29e33056e8a891b3 diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx index bd1e5a2..00766cc 100644 --- a/sal/osl/unx/process_impl.cxx +++ b/sal/osl/unx/process_impl.cxx @@ -176,11 +176,7 @@ sal_uInt32 SAL_CALL osl_getCommandArgCount (void) sal_uInt32 result = 0; pthread_mutex_lock (&(g_command_args.m_mutex)); - if (g_command_args.m_nCount == 0) { - OSL_TRACE( - OSL_LOG_PREFIX - "osl_getCommandArgCount w/o prior call to osl_setCommandArgs"); - } + assert (g_command_args.m_nCount != 0); if (g_command_args.m_nCount > 0) result = g_command_args.m_nCount - 1; pthread_mutex_unlock (&(g_command_args.m_mutex)); @@ -214,7 +210,7 @@ void SAL_CALL osl_setCommandArgs (int argc, char ** argv) { OSL_ASSERT(argc > 0); pthread_mutex_lock (&(g_command_args.m_mutex)); - OSL_ENSURE (g_command_args.m_nCount == 0, "osl_setCommandArgs(): CommandArgs already set."); + assert (g_command_args.m_nCount == 0); if (g_command_args.m_nCount == 0) { rtl_uString** ppArgs = (rtl_uString**)rtl_allocateZeroMemory (argc * sizeof(rtl_uString*)); commit 45ffc53a905aa4b4890d862a070a2d6e9bce8546 Author: Tor Lillqvist <[email protected]> Date: Wed Oct 9 11:52:19 2013 +0300 Revert "Don't ignore -env: command line parameters in some cases" This was the wrong way to fix the problem. The root cause was a static initialiser in the OpenCL code, and that code should not even have been built for iOS. This reverts commit 261f1439e5516f6d60317a675d261af330a9a74c. diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx index 5ee61b0..a4169b3 100644 --- a/sal/rtl/bootstrap.cxx +++ b/sal/rtl/bootstrap.cxx @@ -199,18 +199,9 @@ static sal_Bool getFromCommandLineArgs( } rtl_uString_release( pArg ); } - // If osl_setCommandArgs() has not been called yet (for - // instance, if this gets called from a static initialiser), - // don't initialise pNameValueList, as that would cause the - // code to ignore any -env:FOO=BAR on the command line once - // osl is told about it. - if( nArgCount > 0 ) - pNameValueList = &nameValueList; + pNameValueList = &nameValueList; } - if( ! pNameValueList ) - return sal_False; - sal_Bool found = sal_False; for( NameValueList::iterator ii = pNameValueList->begin() ; commit 8fe9a68f1a10f9bca66c8b959337fd2a522a2f26 Author: Tor Lillqvist <[email protected]> Date: Wed Oct 9 11:51:59 2013 +0300 Update comment to match reality Change-Id: I859ebb6e97a935d6e47a5269253165114fd90a1b diff --git a/config_host/config_features.h.in b/config_host/config_features.h.in index 100706a..7462ba1 100644 --- a/config_host/config_features.h.in +++ b/config_host/config_features.h.in @@ -68,8 +68,7 @@ #define HAVE_FEATURE_MULTIUSER_ENVIRONMENT 0 /* - * Whether we have the OpenCL headers and should compile in any - * support for that abstraction. + * Whether OpenCL is usable on the platform and we should compile in use of OpenCL. */ #define HAVE_FEATURE_OPENCL 0 commit 6d41b096e6a83a567a940884c3c8168682f70a26 Author: Tor Lillqvist <[email protected]> Date: Wed Oct 9 11:50:07 2013 +0300 OpenCL is not available for iOS or Android Change-Id: Iac0cd17dfa0544ec686120d50a6cfdb70336e042 diff --git a/configure.ac b/configure.ac index c351f0b..c936949 100644 --- a/configure.ac +++ b/configure.ac @@ -10322,7 +10322,7 @@ dnl ================================================= AC_MSG_CHECKING([whether to build with the OpenCL support.]) ENABLE_OPENCL= -if test "x$enable_opencl" != "xno"; then +if test $_os != iOS -a $_os != Android -a "x$enable_opencl" != "xno"; then AC_MSG_RESULT([yes]) enable_opencl=yes ENABLE_OPENCL=TRUE _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
