Skip to content

Commit bed9a0e

Browse files
committed
Fix: Conditionally export inplaceConvertFrame* functions for testing only
These internal conversion functions are only needed for unit testing and should not be part of the public API in production builds. - Added CCAP_TEST_EXPORT macro that expands to CCAP_EXPORT only when CCAP_BUILD_TESTS is ON - In production builds (CCAP_BUILD_TESTS=OFF), these functions remain internal - Fixes LNK2019 unresolved external symbol error in shared library test builds - Ensures cleaner API surface in production releases
1 parent f912d7b commit bed9a0e

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/ccap_convert_frame.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,18 @@
3030
/// - Assertion failure in debug builds
3131
/// - Undefined behavior
3232

33+
// Export internal functions only when building tests
34+
#ifdef CCAP_BUILD_TESTS
35+
#define CCAP_TEST_EXPORT CCAP_EXPORT
36+
#else
37+
#define CCAP_TEST_EXPORT
38+
#endif
39+
3340
namespace ccap {
3441

35-
bool inplaceConvertFrame(VideoFrame* frame, PixelFormat toFormat, bool verticalFlip);
36-
bool inplaceConvertFrameRGB(VideoFrame* frame, PixelFormat toFormat, bool verticalFlip);
37-
bool inplaceConvertFrameYUV2RGBColor(VideoFrame* frame, PixelFormat toFormat, bool verticalFlip);
42+
CCAP_TEST_EXPORT bool inplaceConvertFrame(VideoFrame* frame, PixelFormat toFormat, bool verticalFlip);
43+
CCAP_TEST_EXPORT bool inplaceConvertFrameRGB(VideoFrame* frame, PixelFormat toFormat, bool verticalFlip);
44+
CCAP_TEST_EXPORT bool inplaceConvertFrameYUV2RGBColor(VideoFrame* frame, PixelFormat toFormat, bool verticalFlip);
3845

3946
} // namespace ccap
4047

0 commit comments

Comments
 (0)