Skip to content

Commit 8b5ae9f

Browse files
committed
Turn off Turn off whitespace insertion when using boost::wave.
1 parent eb7ad07 commit 8b5ae9f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/liboslcomp/oslcomp.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,10 @@ OSLCompilerImpl::preprocess_buffer (const std::string &buffer,
204204
context_type ctx (instring.begin(), instring.end(), filename.c_str());
205205

206206
// Turn on support of variadic macros, e.g. #define FOO(...) __VA_ARGS__
207+
// Turn off whitespace insertion.
207208
boost::wave::language_support lang = boost::wave::language_support (
208-
ctx.get_language() | boost::wave::support_option_variadics);
209+
(ctx.get_language() | boost::wave::support_option_variadics)
210+
& ~boost::wave::language_support::support_option_insert_whitespace);
209211
ctx.set_language (lang);
210212

211213
ctx.add_macro_definition (OIIO::Strutil::format("OSL_VERSION_MAJOR=%d",

0 commit comments

Comments
 (0)