Skip to content

Commit e5e9160

Browse files
committed
test: define size_t to work around libclang oddities
For some reason clang 6 (and other versions) don't consider anything with `size_t` to have comments unless we do this silly `typedef`. We have a similar workaround in libgit2 itself.
1 parent 1d86b31 commit e5e9160

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/fixtures/git2/common.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@
3939
# define GIT_END_DECL /* empty */
4040
#endif
4141

42+
/*
43+
* libclang won't consider anything with size_t to have comments unless we use
44+
* this hack.
45+
*/
46+
typedef size_t size_t;
47+
4248
/** Declare a public function exported for application use. */
4349
#ifdef __GNUC__
4450
# define GIT_EXTERN(type) extern \

0 commit comments

Comments
 (0)