Skip to content

Commit f0c2b20

Browse files
author
Yu
committed
Document SWIG exclusions for DebugPrint and manual template initialization realted to macro
1 parent 4ac134b commit f0c2b20

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

pcu/PCU.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ class PCU {
110110
int Received(size_t *size) noexcept;
111111
void *Extract(size_t size) noexcept;
112112

113+
/*
114+
* Debug print function with printf-style formatting
115+
* This function is excluded from SWIG parsing due to complex macro usage
116+
* with variadic argument. Also, such functionalities is not needed for the Python API.
117+
*/
113118
#ifndef SWIG
114119
void DebugPrint(const char* format, ...) noexcept PCU_FORMAT_ATTRIBUTE(2, 3)
115120
void DebugPrint(const char* format, va_list args) noexcept;
@@ -143,8 +148,12 @@ void Init(int *argc, char ***argv);
143148
*/
144149
void Finalize();
145150

151+
/*
152+
* Explicit instantiations of template functions,
153+
* ignored by SWIG to avoid difficulties when parsing macros involving
154+
* template functions. Templates are initialized manually in the interface file.
155+
*/
146156
#ifndef SWIG
147-
/* explicit instantiations of template functions */
148157
#define PCU_EXPL_INST_DECL(T) \
149158
extern template void PCU::Add<T>(T * p, size_t n) noexcept; \
150159
extern template T PCU::Add<T>(T p) noexcept; \

0 commit comments

Comments
 (0)