Commit 3e0fb8fb by Ramsay Jones Committed by Andreas Ericsson

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>
parent c8d42b9b
......@@ -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
......
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