Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable nominmax support #490

Merged
merged 4 commits into from
Dec 16, 2023
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
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 2.1.0.{build}
version: 2.1.99.{build}

environment:
PYTHON: "C:\\Python36-x64\\python.exe"
Expand Down
4 changes: 2 additions & 2 deletions external/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Realtime Math

[Realtime Math v2.2.0](https://github.com/nfrechette/rtm) (MIT License) is used for its optimized math.
[Realtime Math v2.2-develop](https://github.com/nfrechette/rtm) (MIT License) is used for its optimized math.

## Development dependencies

Expand All @@ -18,6 +18,6 @@

### sjson-cpp

[sjson-cpp v0.9.0](https://github.com/nfrechette/sjson-cpp/releases/tag/v0.9.0) (MIT License) is used by our [ACL file format](../docs/the_acl_file_format.md) [clip reader](../includes/acl/io/clip_reader.h) and [clip writer](../includes/acl/io/clip_writer.h) as well as by the [acl_compressor](../tools/acl_compressor) tool used for regression testing and profiling. Unless you use our ACL file format at runtime (which you shouldn't), you will not have this dependency included at all.
[sjson-cpp v0.9.0](https://github.com/nfrechette/sjson-cpp) (MIT License) is used by our [ACL file format](../docs/the_acl_file_format.md) [clip reader](../includes/acl/io/clip_reader.h) and [clip writer](../includes/acl/io/clip_writer.h) as well as by the [acl_compressor](../tools/acl_compressor) tool used for regression testing and profiling. Unless you use our ACL file format at runtime (which you shouldn't), you will not have this dependency included at all.

In fact, to use any of these things you must include `sjson-cpp` relevant headers manually before you include the ACL headers that need them. For convenience, you can use the included version here or your own version as long as the API remains compatible.
2 changes: 1 addition & 1 deletion includes/acl/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#define ACL_VERSION_MAJOR 2
#define ACL_VERSION_MINOR 1
#define ACL_VERSION_PATCH 0
#define ACL_VERSION_PATCH 99

////////////////////////////////////////////////////////////////////////////////
// In order to allow multiple versions of this library to coexist side by side
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sonar.organization=nfrechette-github

sonar.projectKey=nfrechette_acl
sonar.projectName=Animation Compression Library
sonar.projectVersion=2.1.0
sonar.projectVersion=2.1.99

sonar.sources=includes,tests/sources,tests/main_generic,tools/acl_compressor/sources,tools/acl_compressor/main_generic,tools/acl_decompressor/main_generic

Expand Down
36 changes: 18 additions & 18 deletions tests/sources/io/test_reader_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,6 @@

#include "catch2.impl.h"

#if defined(ACL_USE_SJSON)
#include <sjson/parser.h>
#include <sjson/writer.h>
#endif

#include <acl/core/ansi_allocator.h>
#include <acl/io/clip_reader.h>
#include <acl/io/clip_writer.h>

#include <rtm/qvvd.h>
#include <rtm/scalarf.h>

#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <thread>

#if defined(_WIN32)
// The below excludes some other unused services from the windows headers -- see windows.h for details.
#define NOGDICAPMASKS // CC_*, LC_*, PC_*, CP_*, TC_*, RC_
Expand All @@ -67,7 +50,7 @@
#define NOMB // MB_* and MessageBox()
#define NOMEMMGR // GMEM_*, LMEM_*, GHND, LHND, associated routines
#define NOMETAFILE // typedef METAFILEPICT
#if !defined(NOMINMAX)
#if !defined(NOMINMAX) && 0 // We leave MIN/MAX macros enabled, they are defined by default and we must handle it
#define NOMINMAX // Macros min(a,b) and max(a,b)
#endif
#define NOMSG // typedef MSG and associated routines
Expand Down Expand Up @@ -103,6 +86,23 @@
#endif
#endif // _WIN32

#if defined(ACL_USE_SJSON)
#include <sjson/parser.h>
#include <sjson/writer.h>
#endif

#include <acl/core/ansi_allocator.h>
#include <acl/io/clip_reader.h>
#include <acl/io/clip_writer.h>

#include <rtm/qvvd.h>
#include <rtm/scalarf.h>

#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <thread>

using namespace acl;

#if defined(RTM_SSE2_INTRINSICS) && defined(ACL_USE_SJSON)
Expand Down
74 changes: 37 additions & 37 deletions tools/acl_compressor/sources/acl_compressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,49 +22,13 @@
// SOFTWARE.
////////////////////////////////////////////////////////////////////////////////

#include "acl_compressor.h"
#include "acl/core/impl/bit_cast.impl.h"

#define DEBUG_MEGA_LARGE_CLIP 0

// Enable 64 bit file IO
#ifndef _WIN32
#define _FILE_OFFSET_BITS 64
#endif

// Used to debug and validate that we compile without sjson-cpp
// Defaults to being enabled
#if defined(ACL_USE_SJSON)
#include <sjson/writer.h>
#include <sjson/parser.h>
#else
namespace sjson { class ArrayWriter; }
#endif

#if defined(RTM_COMPILER_MSVC) && RTM_COMPILER_MSVC > RTM_COMPILER_MSVC_2015
// VS2015 internal state appears to get corrupted when some forward declarations are made
#include "acl/fwd.h" // Make sure forward declaration matches
#endif

#include "acl/core/ansi_allocator.h"
#include "acl/core/floating_point_exceptions.h"
#include "acl/core/string.h"
#include "acl/core/impl/debug_track_writer.h"
#include "acl/compression/compress.h"
#include "acl/compression/convert.h"
#include "acl/compression/pre_process.h"
#include "acl/compression/transform_pose_utils.h" // Just to test compilation
#include "acl/decompression/decompress.h"
#include "acl/io/clip_reader.h"

#include <cstring>
#include <cstdio>
#include <fstream>
#include <streambuf>
#include <sstream>
#include <string>
#include <memory>

#if defined(_WIN32)
// The below excludes some other unused services from the windows headers -- see windows.h for details.
#define NOGDICAPMASKS // CC_*, LC_*, PC_*, CP_*, TC_*, RC_
Expand All @@ -91,7 +55,7 @@
#define NOMB // MB_* and MessageBox()
#define NOMEMMGR // GMEM_*, LMEM_*, GHND, LHND, associated routines
#define NOMETAFILE // typedef METAFILEPICT
#if !defined(NOMINMAX)
#if !defined(NOMINMAX) && 0 // We leave MIN/MAX macros enabled, they are defined by default and we must handle it
#define NOMINMAX // Macros min(a,b) and max(a,b)
#endif
#define NOMSG // typedef MSG and associated routines
Expand Down Expand Up @@ -128,6 +92,42 @@

#endif // _WIN32

#include "acl_compressor.h"
#include "acl/core/impl/bit_cast.impl.h"

// Used to debug and validate that we compile without sjson-cpp
// Defaults to being enabled
#if defined(ACL_USE_SJSON)
#include <sjson/writer.h>
#include <sjson/parser.h>
#else
namespace sjson { class ArrayWriter; }
#endif

#if defined(RTM_COMPILER_MSVC) && RTM_COMPILER_MSVC > RTM_COMPILER_MSVC_2015
// VS2015 internal state appears to get corrupted when some forward declarations are made
#include "acl/fwd.h" // Make sure forward declaration matches
#endif

#include "acl/core/ansi_allocator.h"
#include "acl/core/floating_point_exceptions.h"
#include "acl/core/string.h"
#include "acl/core/impl/debug_track_writer.h"
#include "acl/compression/compress.h"
#include "acl/compression/convert.h"
#include "acl/compression/pre_process.h"
#include "acl/compression/transform_pose_utils.h" // Just to test compilation
#include "acl/decompression/decompress.h"
#include "acl/io/clip_reader.h"

#include <cstring>
#include <cstdio>
#include <fstream>
#include <streambuf>
#include <sstream>
#include <string>
#include <memory>

using namespace acl;

struct Options
Expand Down
Loading