Skip to content

Commit d27879a

Browse files
markfinallgritz
authored andcommitted
Fix to compile OSL debug against OIIO-1.7.x. Previously assumed OIIO 1.8 going by required headers and the new Strutil::printf function (#822)
1 parent bd28ff1 commit d27879a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/liboslcomp/ast.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030
#include <string>
3131
#include <sstream>
3232
#include <functional>
33+
#ifndef NDEBUG
34+
#include <atomic>
35+
#endif
3336

3437
#include "osl_pvt.h"
3538
#include "oslcomp_pvt.h"
@@ -65,8 +68,13 @@ class ScopeExit {
6568
ScopeExit print_node_counts ([](){
6669
for (int i = 0; i < ASTNode::_last_node; ++i)
6770
if (node_counts[i] > 0)
71+
#if OIIO_VERSION >= (10000 * 1 + 100 * 8)
6872
Strutil::printf ("ASTNode type %2d: %5d (peak %5d)\n",
6973
i, node_counts[i], node_counts_peak[i]);
74+
#else
75+
printf("ASTNode type %2d: %5d (peak %5d)\n",
76+
i, node_counts[i], node_counts_peak[i]);
77+
#endif
7078
});
7179
}
7280
#endif

0 commit comments

Comments
 (0)