From d2fac6e417528855ac5366701ac4133a05e5e5a6 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Mon, 17 Mar 2025 15:30:00 -0500 Subject: [PATCH 1/2] Revert "doxygen: fix and improve macro expansion configuration options (#1353)" This reverts commit 05996a5d68fd0f437a4ed2f383860910461c463f. --- Doxyfile | 19 +++++++++++-------- src/bsoncxx/CMakeLists.txt | 5 ----- src/mongocxx/CMakeLists.txt | 5 ----- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/Doxyfile b/Doxyfile index 3c84c6e80a..b74116b92f 100644 --- a/Doxyfile +++ b/Doxyfile @@ -2397,7 +2397,7 @@ MACRO_EXPANSION = YES # The default value is: NO. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_ONLY_PREDEF = NO +EXPAND_ONLY_PREDEF = YES # If the SEARCH_INCLUDES tag is set to YES, the include files in the # INCLUDE_PATH will be searched if a #include is found. @@ -2430,12 +2430,8 @@ 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 = BSONCXX_ABI_CDECL= \ - BSONCXX_ABI_EXPORT= \ - BSONCXX_ABI_EXPORT_CDECL(...)=__VA_ARGS__ \ +PREDEFINED = BSONCXX_ABI_EXPORT_CDECL(...)=__VA_ARGS__ \ BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR= \ - MONGOCXX_ABI_CDECL= \ - MONGOCXX_ABI_EXPORT= \ MONGOCXX_ABI_EXPORT_CDECL(...)=__VA_ARGS__ \ MONGOCXX_PRIVATE_DOXYGEN_PREPROCESSOR= @@ -2446,7 +2442,14 @@ PREDEFINED = BSONCXX_ABI_CDECL= \ # definition found in the source code. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = BSONCXX_ABI_CDECL \ + BSONCXX_ABI_EXPORT \ + BSONCXX_ABI_NO_EXPORT \ + BSONCXX_DEPRECATED \ + MONGOCXX_ABI_CDECL \ + MONGOCXX_ABI_EXPORT \ + MONGOCXX_ABI_NO_EXPORT \ + MONGOCXX_DEPRECATED # If the SKIP_FUNCTION_MACROS tag is set to YES then Doxygen's preprocessor will # remove all references to function-like macros that are alone on a line, have @@ -2456,7 +2459,7 @@ EXPAND_AS_DEFINED = # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -SKIP_FUNCTION_MACROS = NO +SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration options related to external references diff --git a/src/bsoncxx/CMakeLists.txt b/src/bsoncxx/CMakeLists.txt index 05b22be563..5c18db21be 100644 --- a/src/bsoncxx/CMakeLists.txt +++ b/src/bsoncxx/CMakeLists.txt @@ -153,11 +153,6 @@ if(1) /// @warning For internal use only! /// -// Doxygen `PREDEFINED` does not define the macro *in code* as required by `@def`. -#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) -#define BSONCXX_ABI_EXPORT ... -#endif - /// /// @def BSONCXX_ABI_EXPORT /// @hideinitializer diff --git a/src/mongocxx/CMakeLists.txt b/src/mongocxx/CMakeLists.txt index 4651d4a4a5..e92198c7bb 100644 --- a/src/mongocxx/CMakeLists.txt +++ b/src/mongocxx/CMakeLists.txt @@ -121,11 +121,6 @@ if(1) #define MONGOCXX_ABI_EXPORT_CDECL(...) MONGOCXX_ABI_EXPORT __VA_ARGS__ MONGOCXX_ABI_CDECL -// Doxygen `PREDEFINED` does not define the macro *in code* as required by `@def`. -#if defined(MONGOCXX_PRIVATE_DOXYGEN_PREPROCESSOR) -#define MONGOCXX_ABI_EXPORT ... -#endif - /// /// @file /// Provides macros to control the set of symbols exported in the ABI. From b55141f4bfe570c6269640157617e7f055e0baa9 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Mon, 17 Mar 2025 15:31:44 -0500 Subject: [PATCH 2/2] doxygen: predefine non-standard specifiers and fix include paths --- Doxyfile | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/Doxyfile b/Doxyfile index b74116b92f..2199c0e8dd 100644 --- a/Doxyfile +++ b/Doxyfile @@ -2397,7 +2397,7 @@ MACRO_EXPANSION = YES # The default value is: NO. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_ONLY_PREDEF = YES +EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES, the include files in the # INCLUDE_PATH will be searched if a #include is found. @@ -2412,7 +2412,9 @@ SEARCH_INCLUDES = YES # RECURSIVE has no effect here. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = build/doxygen/install/include +INCLUDE_PATH = build/doxygen/install/include/bsoncxx/v_noabi \ + build/doxygen/install/include/mongocxx/v_noabi \ + build/doxygen/install/include # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -2430,9 +2432,11 @@ 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 = BSONCXX_ABI_EXPORT_CDECL(...)=__VA_ARGS__ \ +PREDEFINED = __attribute__(...)= \ + __declspec(...)= \ + _Pragma(...)= \ + __pragma(...)= \ BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR= \ - MONGOCXX_ABI_EXPORT_CDECL(...)=__VA_ARGS__ \ MONGOCXX_PRIVATE_DOXYGEN_PREPROCESSOR= # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this @@ -2442,14 +2446,7 @@ PREDEFINED = BSONCXX_ABI_EXPORT_CDECL(...)=__VA_ARGS__ \ # definition found in the source code. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_AS_DEFINED = BSONCXX_ABI_CDECL \ - BSONCXX_ABI_EXPORT \ - BSONCXX_ABI_NO_EXPORT \ - BSONCXX_DEPRECATED \ - MONGOCXX_ABI_CDECL \ - MONGOCXX_ABI_EXPORT \ - MONGOCXX_ABI_NO_EXPORT \ - MONGOCXX_DEPRECATED +EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then Doxygen's preprocessor will # remove all references to function-like macros that are alone on a line, have @@ -2459,7 +2456,7 @@ EXPAND_AS_DEFINED = BSONCXX_ABI_CDECL \ # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -SKIP_FUNCTION_MACROS = YES +SKIP_FUNCTION_MACROS = NO #--------------------------------------------------------------------------- # Configuration options related to external references