2008-01-14 17:20:58 +03:00
|
|
|
#include <preprocess.h>
|
|
|
|
|
|
|
|
#include FILE_PATH
|
|
|
|
#include TARGET_PATH
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2016-04-29 17:53:13 +03:00
|
|
|
#include <string.h>
|
2008-01-14 17:20:58 +03:00
|
|
|
|
|
|
|
int check_defines_C(void)
|
|
|
|
{
|
|
|
|
int result = 1;
|
2016-05-16 17:34:04 +03:00
|
|
|
if (strcmp(FILE_STRING, STRING_VALUE) != 0) {
|
|
|
|
fprintf(stderr, "FILE_STRING has wrong value in C [%s]\n", FILE_STRING);
|
2008-01-14 17:20:58 +03:00
|
|
|
result = 0;
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
|
|
|
if (strcmp(TARGET_STRING, STRING_VALUE) != 0) {
|
|
|
|
fprintf(stderr, "TARGET_STRING has wrong value in C [%s]\n",
|
|
|
|
TARGET_STRING);
|
2008-01-14 17:20:58 +03:00
|
|
|
result = 0;
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2008-01-14 17:20:58 +03:00
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
int x = 2;
|
|
|
|
int y = 3;
|
|
|
|
if ((FILE_EXPR) != (EXPR)) {
|
|
|
|
fprintf(stderr, "FILE_EXPR did not work in C [%s]\n",
|
|
|
|
TO_STRING(FILE_EXPR));
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
if ((TARGET_EXPR) != (EXPR)) {
|
|
|
|
fprintf(stderr, "TARGET_EXPR did not work in C [%s]\n",
|
|
|
|
TO_STRING(FILE_EXPR));
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#ifdef NDEBUG
|
2016-05-16 17:34:04 +03:00
|
|
|
#ifdef FILE_DEF_DEBUG
|
2008-01-14 17:20:58 +03:00
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "FILE_DEF_DEBUG should not be defined in C\n");
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
#endif
|
|
|
|
#ifdef TARGET_DEF_DEBUG
|
2008-01-14 17:20:58 +03:00
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "TARGET_DEF_DEBUG should not be defined in C\n");
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
#endif
|
|
|
|
#ifdef DIRECTORY_DEF_DEBUG
|
2008-01-18 03:29:43 +03:00
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "DIRECTORY_DEF_DEBUG should not be defined in C\n");
|
|
|
|
result = 0;
|
2008-01-18 03:29:43 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
#endif
|
|
|
|
#ifndef FILE_DEF_RELEASE
|
|
|
|
#ifndef PREPROCESS_XCODE
|
2008-01-14 17:20:58 +03:00
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "FILE_DEF_RELEASE should be defined in C\n");
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#ifndef TARGET_DEF_RELEASE
|
2008-01-14 17:20:58 +03:00
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "TARGET_DEF_RELEASE should be defined in C\n");
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
#endif
|
|
|
|
#ifndef DIRECTORY_DEF_RELEASE
|
2008-01-18 03:29:43 +03:00
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "DIRECTORY_DEF_RELEASE should be defined in C\n");
|
|
|
|
result = 0;
|
2008-01-18 03:29:43 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
#endif
|
2008-01-14 17:20:58 +03:00
|
|
|
#endif
|
|
|
|
#ifdef PREPROCESS_DEBUG
|
2016-05-16 17:34:04 +03:00
|
|
|
#ifndef FILE_DEF_DEBUG
|
|
|
|
#ifndef PREPROCESS_XCODE
|
2008-01-14 17:20:58 +03:00
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "FILE_DEF_DEBUG should be defined in C\n");
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#ifndef TARGET_DEF_DEBUG
|
2008-01-14 17:20:58 +03:00
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "TARGET_DEF_DEBUG should be defined in C\n");
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
#endif
|
|
|
|
#ifndef DIRECTORY_DEF_DEBUG
|
2008-01-18 03:29:43 +03:00
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "DIRECTORY_DEF_DEBUG should be defined in C\n");
|
|
|
|
result = 0;
|
2008-01-18 03:29:43 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
#endif
|
|
|
|
#ifdef FILE_DEF_RELEASE
|
2008-01-14 17:20:58 +03:00
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "FILE_DEF_RELEASE should not be defined in C\n");
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
#endif
|
|
|
|
#ifdef TARGET_DEF_RELEASE
|
2008-01-14 17:20:58 +03:00
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "TARGET_DEF_RELEASE should not be defined in C\n");
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
#endif
|
|
|
|
#ifdef DIRECTORY_DEF_RELEASE
|
2008-01-18 03:29:43 +03:00
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "DIRECTORY_DEF_RELEASE should not be defined in C\n");
|
|
|
|
result = 0;
|
2008-01-18 03:29:43 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
#endif
|
2008-01-14 17:20:58 +03:00
|
|
|
#endif
|
|
|
|
#if defined(FILE_DEF_DEBUG) || defined(TARGET_DEF_DEBUG)
|
2016-05-16 17:34:04 +03:00
|
|
|
#if !defined(FILE_DEF_DEBUG) || !defined(TARGET_DEF_DEBUG)
|
|
|
|
#ifndef PREPROCESS_XCODE
|
2008-01-14 17:20:58 +03:00
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "FILE_DEF_DEBUG and TARGET_DEF_DEBUG inconsistent in C\n");
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if defined(FILE_DEF_RELEASE) || defined(TARGET_DEF_RELEASE)
|
2008-01-14 17:20:58 +03:00
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "DEBUG and RELEASE definitions inconsistent in C\n");
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
#endif
|
2008-01-14 17:20:58 +03:00
|
|
|
#endif
|
|
|
|
#if defined(FILE_DEF_RELEASE) || defined(TARGET_DEF_RELEASE)
|
2016-05-16 17:34:04 +03:00
|
|
|
#if !defined(FILE_DEF_RELEASE) || !defined(TARGET_DEF_RELEASE)
|
|
|
|
#ifndef PREPROCESS_XCODE
|
2008-01-14 17:20:58 +03:00
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr,
|
|
|
|
"FILE_DEF_RELEASE and TARGET_DEF_RELEASE inconsistent in C\n");
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if defined(FILE_DEF_DEBUG) || defined(TARGET_DEF_DEBUG)
|
2008-01-14 17:20:58 +03:00
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "RELEASE and DEBUG definitions inconsistent in C\n");
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
#endif
|
2008-01-14 17:20:58 +03:00
|
|
|
#endif
|
|
|
|
#ifndef FILE_PATH_DEF
|
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "FILE_PATH_DEF not defined in C\n");
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifndef TARGET_PATH_DEF
|
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "TARGET_PATH_DEF not defined in C\n");
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifndef FILE_DEF
|
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "FILE_DEF not defined in C\n");
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifndef TARGET_DEF
|
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "TARGET_DEF not defined in C\n");
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
|
|
|
#endif
|
2008-01-18 03:29:43 +03:00
|
|
|
#ifndef DIRECTORY_DEF
|
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "DIRECTORY_DEF not defined in C\n");
|
|
|
|
result = 0;
|
2008-01-18 03:29:43 +03:00
|
|
|
}
|
|
|
|
#endif
|
2008-01-14 17:20:58 +03:00
|
|
|
#ifndef OLD_DEF
|
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "OLD_DEF not defined in C\n");
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#if !defined(OLD_EXPR) || OLD_EXPR != 2
|
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
fprintf(stderr, "OLD_EXPR id not work in C [%s]\n", TO_STRING(OLD_EXPR));
|
|
|
|
result = 0;
|
2008-01-14 17:20:58 +03:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
return result;
|
|
|
|
}
|