Improving integer width detection

The C preprocessor cannot use sizeof in #if etc.
This commit is contained in:
jsalling
2016-05-03 22:20:34 -05:00
parent 75ad84c92f
commit e4e2210eb6
2 changed files with 46 additions and 86 deletions

View File

@ -34,6 +34,12 @@ test: $(BUILD_DIR)/testunityRunner.c
$(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC) -o $(TARGET)
./$(TARGET)
# Compile only, for testing that preprocessor detection works
UNITY_C_ONLY =-c ../src/unity.c -o $(BUILD_DIR)/unity.o
intDetection:
$(CC) $(CFLAGS) $(INC_DIR) $(UNITY_C_ONLY) -D UNITY_EXCLUDE_STDINT_H
$(CC) $(CFLAGS) $(INC_DIR) $(UNITY_C_ONLY) -D UNITY_EXCLUDE_LIMITS_H
$(BUILD_DIR)/testunityRunner.c: tests/testunity.c | $(BUILD_DIR)
awk $(AWK_SCRIPT) tests/testunity.c > $@