/* * (c) Copyright, Real-Time Innovations, 2023. All rights reserved. * RTI grants Licensee a license to use, modify, compile, and create derivative * works of the software solely for use with RTI Connext DDS. Licensee may * redistribute copies of the software provided that all such copies are subject * to this license. The software is provided "as is", with no warranty of any * type, including any warranty for fitness for any purpose. RTI is under no * obligation to maintain or support the software. RTI shall not be liable for * any incidental or consequential damages arising out of the use or inability * to use the software. */ #include #include #include "ndds/core_version/core_version_buildid.h" // This should be first. #include "ndds/ndds_config_c.h" int main(int argc, char *argv[]) { int retcode = 0; const char *build_id_libs = NULL; char *build_id_core_header = NULL; char build_id_core_lib[128]; char build_id_nddsc_lib[128]; // Retrieve build ID from core libraries: build_id_libs = NDDS_Config_Version_to_string(); if (build_id_libs == NULL) { fprintf(stderr, "Error getting Core version from libraries\n"); return -1; } // Separate BUILD IDs from Core and Nddsc libs: retcode = sscanf( build_id_libs, "%127s\n%127s", build_id_core_lib, build_id_nddsc_lib); if (retcode != 2) { fprintf(stderr, "Error spliting BUILD IDs from libraries\n"); return -1; } // Retrieve build ID from header files: build_id_core_header = RTI_BUILD_NUMBER_STRING; printf("Version Check: "); if(strcmp(build_id_core_header, build_id_core_lib) != 0) { printf("FAILED. Version inconsistency detected!\n"); } else { printf("OK. Versions are consistent\n"); } printf("RTI BUILD ID core library: %s\n", build_id_core_lib); printf("RTI BUILD ID header files: %s\n", build_id_core_header); return 0; }