772 :" "compiler_version[" COMPILER_VERSION "]";
773
774/* Construct a string literal encoding the version number components. */
775#elif defined(COMPILER_VERSION_MAJOR)
776char const info_version[] = {
777 'I', 'N', 'F', 'O', ':',
778 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
779 COMPILER_VERSION_MAJOR,
780# ifdef COMPILER_VERSION_MINOR
781 '.', COMPILER_VERSION_MINOR,
782# ifdef COMPILER_VERSION_PATCH
783 '.', COMPILER_VERSION_PATCH,
784# ifdef COMPILER_VERSION_TWEAK
785 '.', COMPILER_VERSION_TWEAK,
786# endif
787# endif
788# endif
789 ']','\0'};
790#endif
791
792/* Construct a string literal encoding the internal version number. */
793#ifdef COMPILER_VERSION_INTERNAL
794char const info_version_internal[] = {
795 'I', 'N', 'F', 'O', ':',
796 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
797 'i','n','t','e','r','n','a','l','[',
798 COMPILER_VERSION_INTERNAL,']','\0'};
799#elif defined(COMPILER_VERSION_INTERNAL_STR)
800char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
801#endif
802
803/* Construct a string literal encoding the version number components. */
804#ifdef SIMULATE_VERSION_MAJOR
805char const info_simulate_version[] = {
806 'I', 'N', 'F', 'O', ':',
807 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
808 SIMULATE_VERSION_MAJOR,
809# ifdef SIMULATE_VERSION_MINOR
810 '.', SIMULATE_VERSION_MINOR,
811# ifdef SIMULATE_VERSION_PATCH
812 '.', SIMULATE_VERSION_PATCH,
813# ifdef SIMULATE_VERSION_TWEAK
814 '.', SIMULATE_VERSION_TWEAK,
815# endif
816# endif
817# endif
818 ']','\0'};
819#endif
820
821/* Construct the string literal in pieces to prevent the source from
822 getting matched. Store it in a pointer rather than an array
823 because some compilers will just produce instructions to fill the
824 array rather than assigning a pointer to a static array. */
825char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
826char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
827
828
829
830#define C_STD_99 199901L
831#define C_STD_11 201112L
832#define C_STD_17 201710L
833#define C_STD_23 202311L
834
835#ifdef __STDC_VERSION__
836# define C_STD __STDC_VERSION__
837#endif
838
839#if !defined(__STDC__) && !defined(__clang__)
840# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__)
841# define C_VERSION "90"
842# else
843# define C_VERSION
844# endif
845#elif C_STD > C_STD_17
846# define C_VERSION "23"
847#elif C_STD > C_STD_11
848# define C_VERSION "17"
849#elif C_STD > C_STD_99
850# define C_VERSION "11"
851#elif C_STD >= C_STD_99
852# define C_VERSION "99"
853#else
854# define C_VERSION "90"
855#endif
856const char* info_language_standard_default =
857 "INFO" ":" "standard_default[" C_VERSION "]";
858
859const char* info_language_extensions_default = "INFO" ":" "extensions_default["
860#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
861 defined(__TI_COMPILER_VERSION__)) && \
862 !defined(__STRICT_ANSI__)
863 "ON"
864#else
865 "OFF"
866#endif
867"]";
868
869/*--------------------------------------------------------------------------*/
870
871#ifdef ID_VOID_MAIN
872void main() {}
873#else
874# if defined(__CLASSIC_C__)
875int main(argc, argv) int argc; char *argv[];
876# else
877int main(int argc, char* argv[])
878# endif
879{
880 int require = 0;
881 require += info_compiler[argc];
882 require += info_platform[argc];
883 require += info_arch[argc];
884#ifdef COMPILER_VERSION_MAJOR
885 require += info_version[argc];
886#endif
887#if defined(COMPILER_VERSION_INTERNAL) || defined(COMPILER_VERSION_INTERNAL_STR)
888 require += info_version_internal[argc];
889#endif
890#ifdef SIMULATE_ID
891 require += info_simulate[argc];
892#endif
893#ifdef SIMULATE_VERSION_MAJOR
894 require += info_simulate_version[argc];
895#endif
896#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
897 require += info_cray[argc];
898#endif
899 require += info_language_standard_default[argc];
900 require += info_language_extensions_default[argc];
901 (void)argv;
902 return require;
903}
904#endif