diff options
author | Ramsay Jones <ramsay@ramsay1.demon.co.uk> | 2009-06-04 17:12:59 +0100 |
---|---|---|
committer | Andreas Ericsson <ae@op5.se> | 2009-06-05 12:13:48 +0200 |
commit | 3e0fb8fb56426d4645a50ce85fead9ad93ce59ba (patch) | |
tree | 2bf7e29956df690eb8462a49aa1f8ad9a85047bc /src/thread-utils.h | |
parent | c8d42b9bd1b6e45f48feadb5b02e152c5e5f1f62 (diff) | |
download | libgit2-3e0fb8fb56426d4645a50ce85fead9ad93ce59ba.tar.gz |
thread-utils.h: Avoid using a non-standard C construct
In particular, in standard C, a struct or union must have at
least one member declared (ie. structs and unions cannot be
empty). Some compilers allow empty structs as an extension
and won't even issue a warning unless asked for it (eg, gcc
requires -pedantic). Some compilers allow empty structs as
an extension and will only treat it as an error if asked for
strict checking (eg Digital-Mars with -A). Some compilers
simply treat it as an error (eg MS Visual C/C++).
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Andreas Ericsson <ae@op5.se>
Diffstat (limited to 'src/thread-utils.h')
-rw-r--r-- | src/thread-utils.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/thread-utils.h b/src/thread-utils.h index 99228417f..0395b97d1 100644 --- a/src/thread-utils.h +++ b/src/thread-utils.h @@ -69,7 +69,7 @@ GIT_INLINE(int) gitrc_dec(git_refcnt *p) # error GIT_THREADS but no git_lck implementation #else -typedef struct {} git_lck; +typedef struct { int dummy; } git_lck; # define GIT_MUTEX_INIT {} # define gitlck_init(a) (void)0 # define gitlck_lock(a) (void)0 |