[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 <scoped_allocator>`.

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.
<file>. Some will search in the current directory for <file>, while some
will not.

Renaming avoids this problem instead of relying on the behavior of
<file>.
This commit is contained in:
Christopher Warrington 2018-04-19 22:33:12 -07:00 коммит произвёл Ara Ayvazyan
Родитель f9654f53c6
Коммит fbe003db85
3 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -1,10 +1,10 @@
add_bond_codegen (scoped_allocator.bond
add_bond_codegen (scoped_alloc.bond
OPTIONS
--allocator=\"examples::scoped_allocator::MyAllocator<char>\"
--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)

Просмотреть файл

@ -1,4 +1,4 @@
#include "scoped_allocator_reflection.h"
#include "scoped_alloc_reflection.h"
#include <bond/core/bond.h>
#include <bond/stream/output_buffer.h>