Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fe1f477

Browse files
carlosmnEdward Thomson
authored and
Edward Thomson
committed
Add a no-op size_t typedef for the doc parser
Clang's documentation parser, which we use in our documentation system does not report any comments for functions which use size_t as a type. The root cause is buried somewhere in libclang but we can work around it by defining the type ourselves. This typedef makes sure that libclang sees it and that we do not change its size.
1 parent 56da07c commit fe1f477

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/git2/common.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@
2929
# include <inttypes.h>
3030
#endif
3131

32+
#ifdef DOCURIUM
33+
/*
34+
* This is so clang's doc parser acknowledges comments on functions
35+
* with size_t parameters.
36+
*/
37+
typedef size_t size_t;
38+
#endif
39+
3240
/** Declare a public function exported for application use. */
3341
#if __GNUC__ >= 4
3442
# define GIT_EXTERN(type) extern \

0 commit comments

Comments
 (0)