Skip to content

Commit 86201b9

Browse files
authored
Merge pull request libgit2#4135 from libgit2/ethomson/ancient_gcc_not_threadsafe
Provide error on gcc < 4.1 when THREADSAFE
2 parents b13f0da + aa5ea47 commit 86201b9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/thread-utils.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
#ifndef INCLUDE_thread_utils_h__
88
#define INCLUDE_thread_utils_h__
99

10+
#if defined(__GNUC__) && defined(GIT_THREADS)
11+
# if (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 1))
12+
# error Atomic primitives do not exist on this version of gcc; configure libgit2 with -DTHREADSAFE=OFF
13+
# endif
14+
#endif
15+
1016
/* Common operations even if threading has been disabled */
1117
typedef struct {
1218
#if defined(GIT_WIN32)

0 commit comments

Comments
 (0)