From fbe003db8580c3c6f83e47eb6e70f3e8b756caf3 Mon Sep 17 00:00:00 2001 From: Christopher Warrington Date: Thu, 19 Apr 2018 22:33:12 -0700 Subject: [PATCH] [c++] Rename scoped_allocator example Rename the scoped allocator example from "scoped_allocator" to "scoped_alloc" so that it doesn't conflict with the "scoped_allocator" header from the C++ standard library. When `--scoped-alloc` is passed to `gbc`, the generated _types.h header has a `#include `. When using CMake to generate Makefiles, the directory where the _types.h generated file is placed is the same directory where the final executable is placed. When rebuilding the scoped_allocator example, the preprocessor tries to `#include` the previous generated executable. Implementations of the preprocessor differ in how they handle "file" vs. . Some will search in the current directory for , while some will not. Renaming avoids this problem instead of relying on the behavior of . --- examples/cpp/core/scoped_allocator/CMakeLists.txt | 8 ++++---- .../{scoped_allocator.bond => scoped_alloc.bond} | 0 .../{scoped_allocator.cpp => scoped_alloc.cpp} | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename examples/cpp/core/scoped_allocator/{scoped_allocator.bond => scoped_alloc.bond} (100%) rename examples/cpp/core/scoped_allocator/{scoped_allocator.cpp => scoped_alloc.cpp} (95%) diff --git a/examples/cpp/core/scoped_allocator/CMakeLists.txt b/examples/cpp/core/scoped_allocator/CMakeLists.txt index 8e509694..6d63ac28 100644 --- a/examples/cpp/core/scoped_allocator/CMakeLists.txt +++ b/examples/cpp/core/scoped_allocator/CMakeLists.txt @@ -1,10 +1,10 @@ -add_bond_codegen (scoped_allocator.bond +add_bond_codegen (scoped_alloc.bond OPTIONS --allocator=\"examples::scoped_allocator::MyAllocator\" --header=\\\"allocator.h\\\" --alloc-ctors --scoped-alloc) -add_bond_test (scoped_allocator - ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/scoped_allocator_types.cpp - scoped_allocator.cpp) +add_bond_test (scoped_alloc + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/scoped_alloc_types.cpp + scoped_alloc.cpp) diff --git a/examples/cpp/core/scoped_allocator/scoped_allocator.bond b/examples/cpp/core/scoped_allocator/scoped_alloc.bond similarity index 100% rename from examples/cpp/core/scoped_allocator/scoped_allocator.bond rename to examples/cpp/core/scoped_allocator/scoped_alloc.bond diff --git a/examples/cpp/core/scoped_allocator/scoped_allocator.cpp b/examples/cpp/core/scoped_allocator/scoped_alloc.cpp similarity index 95% rename from examples/cpp/core/scoped_allocator/scoped_allocator.cpp rename to examples/cpp/core/scoped_allocator/scoped_alloc.cpp index 24781158..d9c46cc1 100644 --- a/examples/cpp/core/scoped_allocator/scoped_allocator.cpp +++ b/examples/cpp/core/scoped_allocator/scoped_alloc.cpp @@ -1,4 +1,4 @@ -#include "scoped_allocator_reflection.h" +#include "scoped_alloc_reflection.h" #include #include