mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-10-08 03:18:58 +00:00
18461d676f
A compiler or linker may give an error if a .cxx file is empty (that is, declares no symbols). This can happen if an instantiation declaration gets removed during the compile either through preprocessor macros or SFINAE. To protect against this, declare a simple integer with a unique symbol in each instantiation file. The overhead is very small and will prevent compile/link errors.
13 lines
280 B
C++
13 lines
280 B
C++
#ifndef @INSTANTIATION_INC_GUARD@
|
|
#define @INSTANTIATION_INC_GUARD@
|
|
#endif
|
|
|
|
#include <@INSTANTIATION_TEMPLATE_SOURCE@>
|
|
|
|
/* Needed for linking errors when no instantiations */
|
|
int @INSTANTIATION_INC_GUARD@@counter@__;
|
|
|
|
@INSTANTIATION_DECLARATION@
|
|
|
|
#undef @INSTANTIATION_INC_GUARD@
|