mirror of
https://github.com/reactos/CMake.git
synced 2024-11-29 22:40:25 +00:00
b8fc8b324d
Compiler INFO strings built at preprocessing time encode information that must appear as a string literal in the resulting binary. We must make sure the strings appear in the final binary no matter what compiler and flags are used. The previous implementation worked in most places but failed with the GNU linker's --gc-sections option which managed to discard the string. Instead we make the program return value depend on an element of the string indexed by a runtime program parameter, which absolutely requires the string to be present.
29 lines
572 B
C
29 lines
572 B
C
#ifdef __cplusplus
|
|
# error "A C++ compiler has been selected for C."
|
|
#endif
|
|
|
|
#ifdef __CLASSIC_C__
|
|
# define const
|
|
#endif
|
|
|
|
/*--------------------------------------------------------------------------*/
|
|
|
|
#include "CMakeCompilerABI.h"
|
|
|
|
/*--------------------------------------------------------------------------*/
|
|
|
|
#ifdef __CLASSIC_C__
|
|
int main(argc, argv) int argc; char *argv[];
|
|
#else
|
|
int main(int argc, char *argv[])
|
|
#endif
|
|
{
|
|
int require = 0;
|
|
require += info_sizeof_dptr[argc];
|
|
#if defined(ABI_ID)
|
|
require += info_abi[argc];
|
|
#endif
|
|
(void)argv;
|
|
return require;
|
|
}
|