diff options
author | Carlos MartÃn Nieto <carlosmn@github.com> | 2017-02-22 16:17:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-22 16:17:54 +0100 |
commit | 86201b92c336b3bbabe57a661cfe651ae9af4288 (patch) | |
tree | 6db50e7182a04a0563109bf4950755d26b29dc97 | |
parent | b13f0da153aa47fbf113c44e734be2be603870b6 (diff) | |
parent | aa5ea47f7382c85d22282a093674f37fe942f116 (diff) | |
download | libgit2-86201b92c336b3bbabe57a661cfe651ae9af4288.tar.gz |
Merge pull request #4135 from libgit2/ethomson/ancient_gcc_not_threadsafe
Provide error on gcc < 4.1 when THREADSAFE
-rw-r--r-- | src/thread-utils.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/thread-utils.h b/src/thread-utils.h index f0161989f..2df2aeb99 100644 --- a/src/thread-utils.h +++ b/src/thread-utils.h @@ -7,6 +7,12 @@ #ifndef INCLUDE_thread_utils_h__ #define INCLUDE_thread_utils_h__ +#if defined(__GNUC__) && defined(GIT_THREADS) +# if (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 1)) +# error Atomic primitives do not exist on this version of gcc; configure libgit2 with -DTHREADSAFE=OFF +# endif +#endif + /* Common operations even if threading has been disabled */ typedef struct { #if defined(GIT_WIN32) |