~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to include/my_atomic.h

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
 
46
46
  On architectures where these operations are really atomic, rwlocks will
47
47
  be optimized away.
 
48
  8- and 16-bit atomics aren't implemented for windows (see generic-msvc.h),
 
49
  but can be added, if necessary. 
48
50
*/
49
51
 
50
52
#ifndef my_atomic_rwlock_init
83
85
#endif
84
86
#endif
85
87
 
 
88
/*
 
89
  transparent_union doesn't work in g++
 
90
  Bug ?
 
91
 
 
92
  Darwin's gcc doesn't want to put pointers in a transparent_union
 
93
  when built with -arch ppc64. Complains:
 
94
  warning: 'transparent_union' attribute ignored
 
95
*/
86
96
#if defined(__GNUC__) && !defined(__cplusplus) && \
87
97
      ! (defined(__APPLE__) && defined(_ARCH_PPC64))
88
98
/*
170
180
#else /* no inline functions */
171
181
 
172
182
#define make_atomic_add(S)                                      \
173
 
extern int ## S my_atomic_add ## S(Uv_ ## S, U_ ## S);
 
183
extern int ## S my_atomic_add ## S(Uv_ ## S U_a, U_ ## S U_v);
174
184
 
175
185
#define make_atomic_fas(S)                                      \
176
 
extern int ## S my_atomic_fas ## S(Uv_ ## S, U_ ## S);
 
186
extern int ## S my_atomic_fas ## S(Uv_ ## S U_a, U_ ## S U_v);
177
187
 
178
188
#define make_atomic_cas(S)                                      \
179
 
extern int my_atomic_cas ## S(Uv_ ## S, Uv_ ## S, U_ ## S);
 
189
extern int my_atomic_cas ## S(Uv_ ## S U_a, Uv_ ## S U_cmp, U_ ## S U_set);
180
190
 
181
191
#define make_atomic_load(S)                                     \
182
 
extern int ## S my_atomic_load ## S(Uv_ ## S);
 
192
extern int ## S my_atomic_load ## S(Uv_ ## S U_a);
183
193
 
184
194
#define make_atomic_store(S)                                    \
185
 
extern void my_atomic_store ## S(Uv_ ## S, U_ ## S);
 
195
extern void my_atomic_store ## S(Uv_ ## S U_a, U_ ## S U_v);
186
196
 
187
197
#endif
188
198