[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1582438 - /subversion/trunk/subversion/tests/svn_test_main.c

From: Branko Čibej <brane_at_wandisco.com>
Date: Thu, 27 Mar 2014 20:00:50 +0100

On 27.03.2014 19:42, rhuijben_at_apache.org wrote:
> Author: rhuijben
> Date: Thu Mar 27 18:42:30 2014
> New Revision: 1582438
>
> URL: http://svn.apache.org/r1582438
> Log:
> * subversion/tests/svn_test_main.c
> (thread_local): Remove __GNUC__ check in an attempt to fix compilation
> on OpenBSD.
>
> Modified:
> subversion/trunk/subversion/tests/svn_test_main.c
>
> Modified: subversion/trunk/subversion/tests/svn_test_main.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/svn_test_main.c?rev=1582438&r1=1582437&r2=1582438&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/tests/svn_test_main.c (original)
> +++ subversion/trunk/subversion/tests/svn_test_main.c Thu Mar 27 18:42:30 2014
> @@ -153,8 +153,14 @@ static svn_boolean_t skip_cleanup = FALS
> # define thread_local _Thread_local
> # elif defined(WIN32) && defined(_MSC_VER)
> # define thread_local __declspec(thread)
> -# elif defined(__GNUC__)
> +# elif defined(__thread)
> + /* ### Might work somewhere? */
> # define thread_local __thread
> +# else
> + /* gcc defines __thread in some versions, but not all.
> + ### Who knows how to check for this?
> + ### stackoverflow recommends __GNUC__ but that breaks on
> + ### openbsd. */
> # endif
> #endif

Now this makes me wonder why we're not just using the apr_threadkey_*
functions instead of making guesses about compiler support for
thread-local data.

-- Brane

-- 
Branko Čibej | Director of Subversion
WANdisco // Non-Stop Data
e. brane_at_wandisco.com
Received on 2014-03-27 20:01:28 CET

This is an archived mail posted to the Subversion Dev mailing list.