OLD | NEW |
1 /* | 1 /* |
2 ****************************************************************************** | 2 ****************************************************************************** |
3 * | 3 * |
4 * Copyright (C) 1997-2014, International Business Machines | 4 * Copyright (C) 1997-2015, International Business Machines |
5 * Corporation and others. All Rights Reserved. | 5 * Corporation and others. All Rights Reserved. |
6 * | 6 * |
7 ****************************************************************************** | 7 ****************************************************************************** |
8 * | 8 * |
9 * FILE NAME : putilimp.h | 9 * FILE NAME : putilimp.h |
10 * | 10 * |
11 * Date Name Description | 11 * Date Name Description |
12 * 10/17/04 grhoten Move internal functions from putil.h to this file. | 12 * 10/17/04 grhoten Move internal functions from putil.h to this file. |
13 ****************************************************************************** | 13 ****************************************************************************** |
14 */ | 14 */ |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 /* U_HAVE_ATOMIC is typically set by an autoconf test of #include <atomic>
*/ | 222 /* U_HAVE_ATOMIC is typically set by an autoconf test of #include <atomic>
*/ |
223 /* Can be set manually, or left undefined, on platforms without autoconf.
*/ | 223 /* Can be set manually, or left undefined, on platforms without autoconf.
*/ |
224 # if defined(U_HAVE_ATOMIC) && U_HAVE_ATOMIC | 224 # if defined(U_HAVE_ATOMIC) && U_HAVE_ATOMIC |
225 # define U_HAVE_STD_ATOMICS 1 | 225 # define U_HAVE_STD_ATOMICS 1 |
226 # else | 226 # else |
227 # define U_HAVE_STD_ATOMICS 0 | 227 # define U_HAVE_STD_ATOMICS 0 |
228 # endif | 228 # endif |
229 #endif | 229 #endif |
230 | 230 |
231 | 231 |
| 232 /** |
| 233 * \def U_HAVE_CLANG_ATOMICS |
| 234 * Defines whether Clang c11 style built-in atomics are avaialable. |
| 235 * These are used in preference to gcc atomics when both are available. |
| 236 */ |
| 237 #ifdef U_HAVE_CLANG_ATOMICS |
| 238 /* Use the predefined value. */ |
| 239 #elif !defined(__clang__) |
| 240 # define U_HAVE_CLANG_ATOMICS 0 |
| 241 #else |
| 242 #if __has_builtin(__c11_atomic_load) && \ |
| 243 __has_builtin(__c11_atomic_store) && \ |
| 244 __has_builtin(__c11_atomic_fetch_add) && \ |
| 245 __has_builtin(__c11_atomic_fetch_sub) |
| 246 # define U_HAVE_CLANG_ATOMICS 1 |
| 247 #else |
| 248 # define U_HAVE_CLANG_ATOMICS 0 |
| 249 #endif |
| 250 #endif |
| 251 |
232 /*===========================================================================*/ | 252 /*===========================================================================*/ |
233 /** @{ Code alignment */ | 253 /** @{ Code alignment */ |
234 /*===========================================================================*/ | 254 /*===========================================================================*/ |
235 | 255 |
236 /** | 256 /** |
237 * \def U_ALIGN_CODE | 257 * \def U_ALIGN_CODE |
238 * This is used to align code fragments to a specific byte boundary. | 258 * This is used to align code fragments to a specific byte boundary. |
239 * This is useful for getting consistent performance test results. | 259 * This is useful for getting consistent performance test results. |
240 * @internal | 260 * @internal |
241 */ | 261 */ |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 /* also _C_TS_calloc(x) */ | 628 /* also _C_TS_calloc(x) */ |
609 #else | 629 #else |
610 /* C defaults */ | 630 /* C defaults */ |
611 # define uprv_default_malloc(x) malloc(x) | 631 # define uprv_default_malloc(x) malloc(x) |
612 # define uprv_default_realloc(x,y) realloc(x,y) | 632 # define uprv_default_realloc(x,y) realloc(x,y) |
613 # define uprv_default_free(x) free(x) | 633 # define uprv_default_free(x) free(x) |
614 #endif | 634 #endif |
615 | 635 |
616 | 636 |
617 #endif | 637 #endif |
OLD | NEW |