Skip to content

Commit

Permalink
Resolves #58: Moving printf.h and printf.c into the src/ direct…
Browse files Browse the repository at this point in the history
…ory (and marking it as an include directory).
  • Loading branch information
eyalroz committed Nov 11, 2021
1 parent 2b1b062 commit cbff122
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ else()
endif()
set(GENERATED_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/include")
configure_file("printf_config.h.in" "${GENERATED_INCLUDE_DIR}/printf_config.h" @ONLY)
target_sources(printf PRIVATE printf.c "${GENERATED_INCLUDE_DIR}/printf_config.h" printf.h)
target_sources(printf PRIVATE src/printf.c "${GENERATED_INCLUDE_DIR}/printf_config.h" src/printf.h)
target_compile_definitions(printf PRIVATE PRINTF_INCLUDE_CONFIG_H)
target_include_directories(printf PRIVATE "$<BUILD_INTERFACE:${GENERATED_INCLUDE_DIR}>")
target_include_directories(printf PRIVATE src "$<BUILD_INTERFACE:${GENERATED_INCLUDE_DIR}>")

set_property(TARGET printf PROPERTY C_STANDARD 99)
set_property(TARGET printf PROPERTY C_STANDARD_REQUIRED ON)
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/aliasing.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Note: If we include <printf.h>, that will likely get us the
// the file /usr/include/printf.h on Linux systems
#include "../printf.h"
#include "../src/printf.h"

int strcmp_(const char* lhs, const char* rhs)
{
Expand Down
2 changes: 1 addition & 1 deletion test/autotest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <assert.h>

#include "printf_config.h"
#include "../printf.h"
#include "../src/printf.h"

#ifndef PRINTF_ALIAS_STANDARD_FUNCTION_NAMES
#define PRINTF_ALIAS_STANDARD_FUNCTION_NAMES 0
Expand Down
4 changes: 2 additions & 2 deletions test/test_suite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ typedef SSIZE_T ssize_t;

namespace test {
// use functions in own test namespace to avoid stdio conflicts
#include "../printf.h"
#include "../printf.c"
#include "../src/printf.h"
#include "../src/printf.c"
} // namespace test

#define CAPTURE_AND_PRINT(printer_, ...) \
Expand Down

0 comments on commit cbff122

Please sign in to comment.