Skip to content

Commit

Permalink
Fix Huffman performance regression on Linux/clang (AcademySoftwareFou…
Browse files Browse the repository at this point in the history
…ndation#1480)

PR AcademySoftwareFoundation#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 AcademySoftwareFoundation#1479

Signed-off-by: Peter Urbanec <[email protected]>
  • Loading branch information
peterurbanec authored and cary-ilm committed Jul 25, 2023
1 parent 97745e6 commit 171242f
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 171242f

Please sign in to comment.