Merge lp:~paul-lucas/zorba/pjl-misc into lp:zorba

Proposed by Paul J. Lucas
Status: Merged
Approved by: Paul J. Lucas
Approved revision: 11360
Merged at revision: 11668
Proposed branch: lp:~paul-lucas/zorba/pjl-misc
Merge into: lp:zorba
Diff against target: 196 lines (+36/-35)
4 files modified
CMakeLists.txt (+3/-2)
include/zorba/config.h.cmake (+4/-0)
include/zorba/internal/cxx_util.h (+2/-2)
src/util/atomic_int.h (+27/-31)
To merge this branch: bzr merge lp:~paul-lucas/zorba/pjl-misc
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Paul J. Lucas Approve
Review via email: mp+192822@code.launchpad.net

Commit message

Some Mac OS X Mavericks build fixes.

Description of the change

Some Mac OS X Mavericks build fixes.

To post a comment you must log in.
Revision history for this message
Paul J. Lucas (paul-lucas) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue starting for the following merge proposals:
https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/192822

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting criteria failed for the following merge proposals:

https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/192822 :
Votes: {'Approve': 1}

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue result for https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/192822

Stage "CommitZorba" failed.

Check console output at http://jenkins.lambda.nu/job/CommitZorba/243/console to view the results.

Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue starting for the following merge proposals:
https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/192822

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue succeeded - proposal merged!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-08-23 11:15:04 +0000
3+++ CMakeLists.txt 2013-10-27 15:34:19 +0000
4@@ -152,8 +152,9 @@
5 SET(CMAKE_EXTRA_INCLUDE_FILES)
6
7 # C++11 langauge features
8-CHECK_CXX_SOURCE_COMPILES(
9- "int main() { int *p = nullptr; }" ZORBA_CXX_NULLPTR)
10+CHECK_CXX_SOURCE_COMPILES("
11+ #include <cstddef>
12+ int main() { int *p = nullptr; }" ZORBA_CXX_NULLPTR)
13 CHECK_CXX_SOURCE_COMPILES(
14 "int main() { static_assert(1,\"\"); }" ZORBA_CXX_STATIC_ASSERT)
15
16
17=== modified file 'include/zorba/config.h.cmake'
18--- include/zorba/config.h.cmake 2013-08-14 04:32:57 +0000
19+++ include/zorba/config.h.cmake 2013-10-27 15:34:19 +0000
20@@ -136,6 +136,9 @@
21 #if defined( __GNUC__ ) && (__GNUC__ * 100 + __GNUC_MINOR__ < 430)
22 # define ZORBA_GCC_OLDER_THAN_430 1
23 #endif
24+#if defined( __APPLE_CC__ ) && (__APPLE_CC__ >= 5621)
25+# undef ZORBA_GCC_OLDER_THAN_430
26+#endif
27
28 #if defined( _MSC_VER ) && (_MSC_VER < 1600 /* 2010 */)
29 # define ZORBA_MSC_OLDER_THAN_2010 1
30@@ -238,3 +241,4 @@
31 #endif /* BUILDING_ZORBA_STATIC */
32
33 #endif /* ZORBA_CONFIG_H */
34+/* vim:set et sw=2 ts=2: */
35
36=== modified file 'include/zorba/internal/cxx_util.h'
37--- include/zorba/internal/cxx_util.h 2013-06-15 18:13:33 +0000
38+++ include/zorba/internal/cxx_util.h 2013-10-27 15:34:19 +0000
39@@ -21,7 +21,7 @@
40
41 ///////////////////////////////////////////////////////////////////////////////
42
43-#ifndef ZORBA_CXX_NULLPTR
44+#if !defined( ZORBA_CXX_NULLPTR ) && !defined( nullptr )
45
46 namespace zorba {
47 namespace internal {
48@@ -68,7 +68,7 @@
49
50 ///////////////////////////////////////////////////////////////////////////////
51
52-#ifndef ZORBA_CXX_STATIC_ASSERT
53+#if !defined( ZORBA_CXX_STATIC_ASSERT ) && !defined( static_assert )
54
55 template<bool> struct zorba_static_assert; // intentionally undefined
56 template<> struct zorba_static_assert<true> { };
57
58=== modified file 'src/util/atomic_int.h'
59--- src/util/atomic_int.h 2013-02-07 17:24:36 +0000
60+++ src/util/atomic_int.h 2013-10-27 15:34:19 +0000
61@@ -23,11 +23,9 @@
62 # endif
63 #endif
64
65-//
66-// Test first for and prefer gcc's atomic operations over all others since
67-// they're an order of magnitude faster.
68-//
69-#if defined( __GNUC__ )
70+#if defined( __APPLE__ )
71+# include <libkern/OSAtomic.h>
72+#elif defined( __GNUC__ )
73 # if __GNUC__ * 100 + __GNUC_MINOR__ >= 402
74 # include <ext/atomicity.h>
75 # else
76@@ -38,8 +36,6 @@
77 # else
78 # define GNU_EXCHANGE_AND_ADD __gnu_cxx::__exchange_and_add
79 # endif
80-#elif defined( __APPLE__ )
81-# include <libkern/OSAtomic.h>
82 #elif defined( __FreeBSD__ )
83 # include <sys/types.h>
84 # include <machine/atomic.h>
85@@ -66,10 +62,10 @@
86 */
87 class atomic_int {
88 public:
89-#if defined( __GNUC__ )
90+#if defined( __APPLE__ ) || defined( __NetBSD__ ) || defined( __SOLARIS__ )
91+ typedef int32_t value_type;
92+#elif defined( __GNUC__ )
93 typedef _Atomic_word value_type;
94-#elif defined( __APPLE__ ) || defined( __NetBSD__ ) || defined( __SOLARIS__ )
95- typedef int32_t value_type;
96 #elif defined( __FreeBSD__ )
97 typedef int value_type;
98 #elif defined( _WIN32 )
99@@ -175,10 +171,10 @@
100 return atomic_load_acq_int( &value_ );
101 #else
102 value_type const temp = *(value_type volatile*)&value_;
103-# if defined( __GNUC__ )
104+# if defined( __APPLE__ )
105+ OSMemoryBarrier();
106+# elif defined( __GNUC__ )
107 _GLIBCXX_READ_MEM_BARRIER;
108-# elif defined( __APPLE__ )
109- OSMemoryBarrier();
110 # elif defined( __NetBSD__ ) || defined( __SOLARIS__ )
111 membar_consumer();
112 # elif defined( _WIN32 )
113@@ -196,10 +192,10 @@
114 #elif defined( _WIN32 )
115 InterlockedExchange( &value_, n );
116 #else
117-# if defined( __GNUC__ )
118+# if defined( __APPLE__ )
119+ OSMemoryBarrier();
120+# elif defined( __GNUC__ )
121 _GLIBCXX_WRITE_MEM_BARRIER;
122-# elif defined( __APPLE__ )
123- OSMemoryBarrier();
124 # elif defined( __NetBSD__ ) || defined( __SOLARIS__ )
125 membar_producer();
126 # elif defined( __INTEL_COMPILER )
127@@ -210,10 +206,10 @@
128 }
129
130 value_type add( value_type n ) {
131-#if defined( __GNUC__ )
132+#if defined( __APPLE__ )
133+ return OSAtomicAdd32( n, &value_ );
134+#elif defined( __GNUC__ )
135 return GNU_EXCHANGE_AND_ADD( &value_, n ) + n;
136-#elif defined( __APPLE__ )
137- return OSAtomicAdd32( n, &value_ );
138 #elif defined( __FreeBSD__ )
139 return atomic_fetchadd_int( &value_, n ) + n;
140 #elif defined( __NetBSD__ )
141@@ -226,10 +222,10 @@
142 }
143
144 value_type pre_dec() {
145-#if defined( __GNUC__ )
146+#if defined( __APPLE__ )
147+ return OSAtomicDecrement32( &value_ );
148+#elif defined( __GNUC__ )
149 return GNU_EXCHANGE_AND_ADD( &value_, -1 ) - 1;
150-#elif defined( __APPLE__ )
151- return OSAtomicDecrement32( &value_ );
152 #elif defined( __FreeBSD__ )
153 return atomic_fetchadd_int( &value_, -1 ) - 1;
154 #elif defined( __NetBSD__ )
155@@ -242,10 +238,10 @@
156 }
157
158 value_type pre_inc() {
159-#if defined( __GNUC__ )
160+#if defined( __APPLE__ )
161+ return OSAtomicIncrement32( &value_ );
162+#elif defined( __GNUC__ )
163 return GNU_EXCHANGE_AND_ADD( &value_, 1 ) + 1;
164-#elif defined( __APPLE__ )
165- return OSAtomicIncrement32( &value_ );
166 #elif defined( __FreeBSD__ )
167 return atomic_fetchadd_int( &value_, 1 ) + 1;
168 #elif defined( __NetBSD__ )
169@@ -258,10 +254,10 @@
170 }
171
172 value_type post_dec() {
173-#if defined( __GNUC__ )
174+#if defined( __APPLE__ )
175+ return OSAtomicDecrement32( &value_ ) + 1;
176+#elif defined( __GNUC__ )
177 return GNU_EXCHANGE_AND_ADD( &value_, -1 );
178-#elif defined( __APPLE__ )
179- return OSAtomicDecrement32( &value_ ) + 1;
180 #elif defined( __FreeBSD__ )
181 return atomic_fetchadd_int( &value_, -1 );
182 #elif defined( __NetBSD__ )
183@@ -274,10 +270,10 @@
184 }
185
186 value_type post_inc() {
187-#if defined( __GNUC__ )
188+#if defined( __APPLE__ )
189+ return OSAtomicIncrement32( &value_ ) - 1;
190+#elif defined( __GNUC__ )
191 return GNU_EXCHANGE_AND_ADD( &value_, 1 );
192-#elif defined( __APPLE__ )
193- return OSAtomicIncrement32( &value_ ) - 1;
194 #elif defined( __FreeBSD__ )
195 return atomic_fetchadd_int( &value_, 1 );
196 #elif defined( __NetBSD__ )

Subscribers

People subscribed via source and target branches