Commit e3fe32b6 by Ramsay Jones

Fix "'__thread' not at start of declaration" warnings (-Wextra)

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
parent 0ef9d2aa
...@@ -17,6 +17,7 @@ CASE_SENSE_NAMES = NO ...@@ -17,6 +17,7 @@ CASE_SENSE_NAMES = NO
PREDEFINED = \ PREDEFINED = \
"GIT_EXTERN(x)=x" \ "GIT_EXTERN(x)=x" \
"GIT_EXTERN_TLS(x)=x" \
"GIT_INLINE(x)=x" \ "GIT_INLINE(x)=x" \
"GIT_BEGIN_DECL=" \ "GIT_BEGIN_DECL=" \
"GIT_END_DECL=" \ "GIT_END_DECL=" \
......
#ifndef INCLUDE_git_common_h__ #ifndef INCLUDE_git_common_h__
#define INCLUDE_git_common_h__ #define INCLUDE_git_common_h__
#include "thread-utils.h"
#ifdef __cplusplus #ifdef __cplusplus
# define GIT_BEGIN_DECL extern "C" { # define GIT_BEGIN_DECL extern "C" {
# define GIT_END_DECL } # define GIT_END_DECL }
...@@ -20,6 +22,16 @@ ...@@ -20,6 +22,16 @@
# define GIT_EXTERN(type) extern type # define GIT_EXTERN(type) extern type
#endif #endif
/** Declare a public TLS symbol exported for application use. */
#ifdef __GNUC__
# define GIT_EXTERN_TLS(type) extern \
__attribute__((visibility("default"))) \
GIT_TLS \
type
#else
# define GIT_EXTERN_TLS(type) extern GIT_TLS type
#endif
/** Declare a function as always inlined. */ /** Declare a function as always inlined. */
#if defined(_MSC_VER) #if defined(_MSC_VER)
# define GIT_INLINE(type) static __inline type # define GIT_INLINE(type) static __inline type
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#define INCLUDE_git_errors_h__ #define INCLUDE_git_errors_h__
#include "common.h" #include "common.h"
#include "thread-utils.h"
/** /**
* @file git/errors.h * @file git/errors.h
...@@ -14,7 +13,7 @@ GIT_BEGIN_DECL ...@@ -14,7 +13,7 @@ GIT_BEGIN_DECL
/** The git errno. */ /** The git errno. */
#if defined(GIT_TLS) #if defined(GIT_TLS)
GIT_EXTERN(int) GIT_TLS git_errno; GIT_EXTERN_TLS(int) git_errno;
#elif defined(GIT_HAS_PTHREAD) #elif defined(GIT_HAS_PTHREAD)
# define git_errno (*git__errno_storage()) # define git_errno (*git__errno_storage())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment