summaryrefslogtreecommitdiff
path: root/lib/builtins/emutls.c
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2015-10-10 21:21:28 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2015-10-10 21:21:28 +0000
commit85a0d7111560dde86ef2885ea214d5438eb6ee92 (patch)
treedb370354ab17791f14477a6ad132a639e7ec4fce /lib/builtins/emutls.c
parent1823f5f680ae81f5e39f158c0f201431acad1667 (diff)
downloadcompiler-rt-85a0d7111560dde86ef2885ea214d5438eb6ee92.tar.gz
builtins: spell inline as __inline
__inline is a vendor specific spelling for inline. clang and gcc treat it the same as inline, and is available in MSVC 2013 which does not implement C99 (VS2015 supports the inline keyword though). This will allow us to build the builtins using MSVC. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249953 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/builtins/emutls.c')
-rw-r--r--lib/builtins/emutls.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/builtins/emutls.c b/lib/builtins/emutls.c
index 86f31ce01..09e79568b 100644
--- a/lib/builtins/emutls.c
+++ b/lib/builtins/emutls.c
@@ -37,7 +37,7 @@ typedef struct __emutls_control {
void* value; /* null or non-zero initial value for the object */
} __emutls_control;
-static inline void* emutls_memalign_alloc(size_t align, size_t size) {
+static __inline void *emutls_memalign_alloc(size_t align, size_t size) {
void *base;
#if EMUTLS_USE_POSIX_MEMALIGN
if (posix_memalign(&base, align, size) != 0)
@@ -55,7 +55,7 @@ static inline void* emutls_memalign_alloc(size_t align, size_t size) {
return base;
}
-static inline void emutls_memalign_free(void* base) {
+static __inline void emutls_memalign_free(void *base) {
#if EMUTLS_USE_POSIX_MEMALIGN
free(base);
#else
@@ -65,7 +65,7 @@ static inline void emutls_memalign_free(void* base) {
}
/* Emulated TLS objects are always allocated at run-time. */
-static inline void* emutls_allocate_object(__emutls_control* control) {
+static __inline void *emutls_allocate_object(__emutls_control *control) {
/* Use standard C types, check with gcc's emutls.o. */
typedef unsigned int gcc_word __attribute__((mode(word)));
typedef unsigned int gcc_pointer __attribute__((mode(pointer)));
@@ -116,7 +116,7 @@ static void emutls_init(void) {
}
/* Returns control->object.index; set index if not allocated yet. */
-static inline uintptr_t emutls_get_index(__emutls_control* control) {
+static __inline uintptr_t emutls_get_index(__emutls_control *control) {
uintptr_t index = __atomic_load_n(&control->object.index, __ATOMIC_ACQUIRE);
if (!index) {
static pthread_once_t once = PTHREAD_ONCE_INIT;
@@ -133,8 +133,8 @@ static inline uintptr_t emutls_get_index(__emutls_control* control) {
}
/* Updates newly allocated thread local emutls_address_array. */
-static inline void emutls_check_array_set_size(emutls_address_array* array,
- uintptr_t size) {
+static __inline void emutls_check_array_set_size(emutls_address_array *array,
+ uintptr_t size) {
if (array == NULL)
abort();
array->size = size;
@@ -144,7 +144,7 @@ static inline void emutls_check_array_set_size(emutls_address_array* array,
/* Returns the new 'data' array size, number of elements,
* which must be no smaller than the given index.
*/
-static inline uintptr_t emutls_new_data_array_size(uintptr_t index) {
+static __inline uintptr_t emutls_new_data_array_size(uintptr_t index) {
/* Need to allocate emutls_address_array with one extra slot
* to store the data array size.
* Round up the emutls_address_array size to multiple of 16.
@@ -155,7 +155,8 @@ static inline uintptr_t emutls_new_data_array_size(uintptr_t index) {
/* Returns the thread local emutls_address_array.
* Extends its size if necessary to hold address at index.
*/
-static inline emutls_address_array* emutls_get_address_array(uintptr_t index) {
+static __inline emutls_address_array *
+emutls_get_address_array(uintptr_t index) {
emutls_address_array* array = pthread_getspecific(emutls_pthread_key);
if (array == NULL) {
uintptr_t new_size = emutls_new_data_array_size(index);