mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 15:10:02 +00:00
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>
This commit is contained in:
parent
c8d42b9bd1
commit
3e0fb8fb56
@ -69,7 +69,7 @@ GIT_INLINE(int) gitrc_dec(git_refcnt *p)
|
|||||||
# error GIT_THREADS but no git_lck implementation
|
# error GIT_THREADS but no git_lck implementation
|
||||||
|
|
||||||
#else
|
#else
|
||||||
typedef struct {} git_lck;
|
typedef struct { int dummy; } git_lck;
|
||||||
# define GIT_MUTEX_INIT {}
|
# define GIT_MUTEX_INIT {}
|
||||||
# define gitlck_init(a) (void)0
|
# define gitlck_init(a) (void)0
|
||||||
# define gitlck_lock(a) (void)0
|
# define gitlck_lock(a) (void)0
|
||||||
|
Loading…
Reference in New Issue
Block a user