Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions Code/max/Testing/TestingExport.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2026, The max Contributors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MAX_TESTING_EXPORT_HPP
#define MAX_TESTING_EXPORT_HPP

// There are functions which are only used within a given translation unit.
// They should not be exported to the linker.

// However, you will want to test those functions. And since the test code
// likely lives in a different file, you *will* want the functions to be
// exported to the linker.

// If a project has the definition MAX_TEST, these macros will export the
// functions marked with them.
// A normal project won't define MAX_TEST and so the functions remain hidden.

#ifdef MAX_TEST
#define MAX_TESTING_EXPORT_DECLARATION( Declaration ) Declaration
#define MAX_TESTING_EXPORT_DEFINITION( Definition ) Definition
#else
#define MAX_TESTING_EXPORT_DECLARATION( Declaration )
#define MAX_TESTING_EXPORT_DEFINITION( Definition ) static Definition
#endif

#endif // #ifndef MAX_TESTING_EXPORT_HPP
1 change: 1 addition & 0 deletions Projects/VisualStudio/max/max.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@
<ClInclude Include="..\..\..\Code\max\Logging\DoNothingLogger.hpp" />
<ClInclude Include="..\..\..\Code\max\Testing\CoutResultPolicy.hpp" />
<ClInclude Include="..\..\..\Code\max\Testing\Test.hpp" />
<ClInclude Include="..\..\..\Code\max\Testing\TestingExport.hpp" />
<ClInclude Include="..\..\..\Code\max\Testing\TestSuite.hpp" />
</ItemGroup>
<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions Projects/VisualStudio/max/max.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,9 @@
<ClInclude Include="..\..\..\Code\max\Algorithms\DeferTest.hpp">
<Filter>Code\max\Algorithms</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Code\max\Testing\TestingExport.hpp">
<Filter>Code\max\Testing</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\Code\max\Algorithms\IsBetweenTest.cpp">
Expand Down
Loading