From 3e0fb8fb56426d4645a50ce85fead9ad93ce59ba Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Thu, 4 Jun 2009 17:12:59 +0100 Subject: [PATCH] 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 Signed-off-by: Andreas Ericsson --- src/thread-utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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