Skip to content

Commit

Permalink
Work around Doxygen GCC attribute issue
Browse files Browse the repository at this point in the history
Doxygen failed to properly parse GCC function attributes, which
resulted in repeated return types in the documentation.

Signed-off-by: Mattias Rönnblom <[email protected]>
  • Loading branch information
m-ronnblom committed Nov 28, 2024
1 parent 91891fc commit 5cb567f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
4 changes: 2 additions & 2 deletions doc/doxygen.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2336,7 +2336,7 @@ ENABLE_PREPROCESSING = YES
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

MACRO_EXPANSION = NO
MACRO_EXPANSION = YES

# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
# the macro expansion is limited to the macros specified with the PREDEFINED and
Expand Down Expand Up @@ -2377,7 +2377,7 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

PREDEFINED =
PREDEFINED = __DOXYGEN__

# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
Expand Down
30 changes: 24 additions & 6 deletions include/xcm_attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,10 @@ int xcm_attr_get_bin(struct xcm_socket *socket, const char *name,

int xcm_attr_getf(struct xcm_socket *socket, enum xcm_attr_type *type,
void *value, size_t capacity, const char *fmt, ...)
__attribute__ ((format (printf, 5, 6)));
#ifndef __DOXYGEN__
__attribute__(format (printf, 5, 6))
#endif
;

/** Retrieves the value of a boolean socket attribute using a formatted name.
*
Expand All @@ -275,7 +278,10 @@ int xcm_attr_getf(struct xcm_socket *socket, enum xcm_attr_type *type,

int xcm_attr_getf_bool(struct xcm_socket *socket, bool *value,
const char *name_fmt, ...)
__attribute__ ((format (printf, 3, 4)));
#ifndef __DOXYGEN__
__attribute__(format (printf, 3, 4))
#endif
;

/** Retrieves the value of an integer socket attribute using a formatted name.
*
Expand All @@ -295,7 +301,10 @@ int xcm_attr_getf_bool(struct xcm_socket *socket, bool *value,

int xcm_attr_getf_int64(struct xcm_socket *socket, int64_t *value,
const char *name_fmt, ...)
__attribute__ ((format (printf, 3, 4)));
#ifndef __DOXYGEN__
__attribute__(format (printf, 3, 4))
#endif
;

/** Retrieves the value of a double type socket attribute using a formatted name.
*
Expand All @@ -315,7 +324,10 @@ int xcm_attr_getf_int64(struct xcm_socket *socket, int64_t *value,

int xcm_attr_getf_double(struct xcm_socket *socket, double *value,
const char *name_fmt, ...)
__attribute__ ((format (printf, 3, 4)));
#ifndef __DOXYGEN__
__attribute__(format (printf, 3, 4))
#endif
;

/** Retrieves the value of a string socket attribute using a formatted name.
*
Expand All @@ -337,7 +349,10 @@ int xcm_attr_getf_double(struct xcm_socket *socket, double *value,

int xcm_attr_getf_str(struct xcm_socket *socket, char *value, size_t capacity,
const char *name_fmt, ...)
__attribute__ ((format (printf, 4, 5)));
#ifndef __DOXYGEN__
__attribute__(format (printf, 4, 5))
#endif
;

/** Retrieves the value of a binary socket attribute using a formatted name.
*
Expand All @@ -358,7 +373,10 @@ int xcm_attr_getf_str(struct xcm_socket *socket, char *value, size_t capacity,

int xcm_attr_getf_bin(struct xcm_socket *socket, void *value, size_t capacity,
const char *name_fmt, ...)
__attribute__ ((format (printf, 4, 5)));
#ifndef __DOXYGEN__
__attribute__(format (printf, 4, 5))
#endif
;

/** Get the length of a socket attribute list.
*
Expand Down

0 comments on commit 5cb567f

Please sign in to comment.