Skip to content

Commit

Permalink
Fix Huffman performance regression on Linux/clang (#1480)
Browse files Browse the repository at this point in the history
PR #1323 introduces a nested #ifdef check that results in a performance
regression on Linux systems that use the clang compiler. This is because
the check for __clang__ succeeds, but the nested check for __APPLE__
fails. As a result, the elif case is not taken on Linux.

Fixes issue #1479

Signed-off-by: Peter Urbanec <[email protected]>
  • Loading branch information
peterurbanec authored Jul 9, 2023
1 parent f3fc12b commit 114cc64
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/lib/OpenEXR/ImfFastHuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@
// Static enabling/disabling the fast huffman decode


#if defined(__clang__)
#if defined(__APPLE__) && defined(__clang__)
//
// Enabled for clang on Apple platforms (tested):
//

# if defined(__APPLE__)
# define OPENEXR_IMF_ENABLE_FAST_HUF_DECODER
# endif
# define OPENEXR_IMF_ENABLE_FAST_HUF_DECODER

#elif defined(__INTEL_COMPILER) || defined(__GNUC__)
//
Expand Down

0 comments on commit 114cc64

Please sign in to comment.