Skip to content

Commit f6f9e26

Browse files
lgritz1div0
authored andcommitted
ci: Rename macro to avoid conflict during CI unity builds (AcademySoftwareFoundation#4092)
Unity builds (which we do for CI to speed it up) combine source files, sometimes in ways that are a bit non-deterministic, and can run into violations of the ODR that were not a problem when separate definitions of the same thing (a macro in this case) were in different compilation units but are in the same one as a unity build. In this case, a private OIIO_DISPATCH_TYPES macro in printinfo.cpp conflicted with a different macro of the same name in imagebufalgo_util.h. Signed-off-by: Larry Gritz <[email protected]> Signed-off-by: Peter Kovář <[email protected]>
1 parent 7a73e5f commit f6f9e26

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/oiiotool/printinfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ dump_flat_data(std::ostream& out, ImageInput* input,
149149

150150

151151
// Macro to call a type-specialzed version func<type>(R,...)
152-
#define OIIO_DISPATCH_TYPES(ret, name, func, type, R, ...) \
152+
#define PRINTINFO_DISPATCH_TYPES(ret, name, func, type, R, ...) \
153153
switch (type.basetype) { \
154154
case TypeDesc::FLOAT: ret = func<float>(R, __VA_ARGS__); break; \
155155
case TypeDesc::UINT8: ret = func<unsigned char>(R, __VA_ARGS__); break; \
@@ -211,8 +211,8 @@ dump_data(std::ostream& out, ImageInput* input,
211211

212212
} else {
213213
OIIO_UNUSED_OK bool ok = true;
214-
OIIO_DISPATCH_TYPES(ok, "dump_flat_data", dump_flat_data, spec.format,
215-
out, input, opt, subimage);
214+
PRINTINFO_DISPATCH_TYPES(ok, "dump_flat_data", dump_flat_data,
215+
spec.format, out, input, opt, subimage);
216216
}
217217
}
218218

0 commit comments

Comments
 (0)