Skip to content

Commit

Permalink
remove core/ from include path
Browse files Browse the repository at this point in the history
core/ and core/math have been in the default include path, this can
cause trouble when a direction has files with the same basename as
files in core/ or core/math. (see godotengine#10071)

In order to fix such future problems all core/... includes need to
be explicit, preventing the compiler *not* including core files when
files with same basename are present.
  • Loading branch information
karroffel committed Aug 22, 2017
1 parent 19e1242 commit fbf3487
Show file tree
Hide file tree
Showing 801 changed files with 3,200 additions and 3,073 deletions.
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Help(opts.GenerateHelpText(env_base)) # generate help

# add default include paths

env_base.Append(CPPPATH=['#core', '#core/math', '#editor', '#drivers', '#'])
env_base.Append(CPPPATH=['#editor', '#drivers', '#'])

# configure ENV for platform
env_base.platform_exporters = platform_exporters
Expand Down
2 changes: 1 addition & 1 deletion core/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ for x in env.global_defaults:
gd_inc += '#include "platform/' + x + '/globals/global_defaults.h"\n'
gd_call += "\tregister_" + x + "_global_defaults();\n"

gd_cpp = '#include "project_settings.h"\n'
gd_cpp = '#include "core/project_settings.h"\n'
gd_cpp += gd_inc
gd_cpp += "void ProjectSettings::register_global_defaults() {\n" + gd_call + "\n}\n"

Expand Down
2 changes: 1 addition & 1 deletion core/allocators.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#ifndef ALLOCATORS_H
#define ALLOCATORS_H

#include "os/memory.h"
#include "core/os/memory.h"
template <int PREALLOC_COUNT = 64, int MAX_HANDS = 8>
class BalloonAllocator {

Expand Down
10 changes: 5 additions & 5 deletions core/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "array.h"
#include "core/array.h"

#include "hashfuncs.h"
#include "object.h"
#include "variant.h"
#include "vector.h"
#include "core/hashfuncs.h"
#include "core/object.h"
#include "core/variant.h"
#include "core/vector.h"

struct ArrayPrivate {

Expand Down
2 changes: 1 addition & 1 deletion core/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#ifndef ARRAY_H
#define ARRAY_H

#include "typedefs.h"
#include "core/typedefs.h"
class Variant;
class ArrayPrivate;
class Object;
Expand Down
12 changes: 6 additions & 6 deletions core/bind/core_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
/*************************************************************************/
#include "core_bind.h"

#include "core/io/file_access_compressed.h"
#include "core/io/file_access_encrypted.h"
#include "core/io/marshalls.h"
#include "core/math/geometry.h"
#include "core/os/keyboard.h"
#include "core/os/os.h"
#include "core/project_settings.h"
#include "geometry.h"
#include "io/file_access_compressed.h"
#include "io/file_access_encrypted.h"
#include "io/marshalls.h"
#include "os/keyboard.h"
#include "os/os.h"

#include "thirdparty/misc/base64.h"

Expand Down
18 changes: 9 additions & 9 deletions core/bind/core_bind.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
#ifndef CORE_BIND_H
#define CORE_BIND_H

#include "image.h"
#include "io/compression.h"
#include "io/resource_loader.h"
#include "io/resource_saver.h"
#include "os/dir_access.h"
#include "os/file_access.h"
#include "os/power.h"
#include "os/semaphore.h"
#include "os/thread.h"
#include "core/image.h"
#include "core/io/compression.h"
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
#include "core/os/power.h"
#include "core/os/semaphore.h"
#include "core/os/thread.h"

class _ResourceLoader : public Object {
GDCLASS(_ResourceLoader, Object);
Expand Down
6 changes: 3 additions & 3 deletions core/class_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "class_db.h"
#include "core/class_db.h"

#include "os/mutex.h"
#include "version.h"
#include "core/os/mutex.h"
#include "core/version.h"

#ifdef NO_THREADS

Expand Down
6 changes: 3 additions & 3 deletions core/class_db.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
#ifndef CLASS_DB_H
#define CLASS_DB_H

#include "method_bind.h"
#include "object.h"
#include "print_string.h"
#include "core/method_bind.h"
#include "core/object.h"
#include "core/print_string.h"

/**
@author Juan Linietsky <[email protected]>
Expand Down
8 changes: 4 additions & 4 deletions core/color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "color.h"
#include "core/color.h"

#include "color_names.inc"
#include "map.h"
#include "math_funcs.h"
#include "print_string.h"
#include "core/map.h"
#include "core/math/math_funcs.h"
#include "core/print_string.h"

uint32_t Color::to_ARGB32() const {

Expand Down
4 changes: 2 additions & 2 deletions core/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#ifndef COLOR_H
#define COLOR_H

#include "math_funcs.h"
#include "ustring.h"
#include "core/math/math_funcs.h"
#include "core/ustring.h"
/**
@author Juan Linietsky <[email protected]>
*/
Expand Down
4 changes: 2 additions & 2 deletions core/color_names.inc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Names from https://en.wikipedia.org/wiki/List_of_colors (through https://raw.githubusercontent.com/SuperUserNameMan/color_to_name/616a7cddafefda91478b7bc26167de97fb5badb1/godot_version.gd), slightly edited and normalized
#include "map.h"
#include "core/map.h"

static Map<String, Color> _named_colors;
static void _populate_named_colors() {
if(!_named_colors.empty()) return;
if (!_named_colors.empty()) return;
_named_colors.insert("aliceblue", Color(0.94, 0.97, 1.00));
_named_colors.insert("antiquewhite", Color(0.98, 0.92, 0.84));
_named_colors.insert("aqua", Color(0.00, 1.00, 1.00));
Expand Down
4 changes: 2 additions & 2 deletions core/command_queue_mt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "command_queue_mt.h"
#include "core/command_queue_mt.h"

#include "os/os.h"
#include "core/os/os.h"

void CommandQueueMT::lock() {

Expand Down
10 changes: 5 additions & 5 deletions core/command_queue_mt.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
#ifndef COMMAND_QUEUE_MT_H
#define COMMAND_QUEUE_MT_H

#include "os/memory.h"
#include "os/mutex.h"
#include "os/semaphore.h"
#include "simple_type.h"
#include "typedefs.h"
#include "core/os/memory.h"
#include "core/os/mutex.h"
#include "core/os/semaphore.h"
#include "core/simple_type.h"
#include "core/typedefs.h"
/**
@author Juan Linietsky <[email protected]>
*/
Expand Down
4 changes: 2 additions & 2 deletions core/compressed_translation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "compressed_translation.h"
#include "core/compressed_translation.h"

#include "pair.h"
#include "core/pair.h"

extern "C" {
#include "thirdparty/misc/smaz.h"
Expand Down
2 changes: 1 addition & 1 deletion core/compressed_translation.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#ifndef COMPRESSED_TRANSLATION_H
#define COMPRESSED_TRANSLATION_H

#include "translation.h"
#include "core/translation.h"

class PHashTranslation : public Translation {

Expand Down
2 changes: 1 addition & 1 deletion core/core_string_names.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "core_string_names.h"
#include "core/core_string_names.h"

CoreStringNames *CoreStringNames::singleton = NULL;

Expand Down
2 changes: 1 addition & 1 deletion core/core_string_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#ifndef CORE_STRING_NAMES_H
#define CORE_STRING_NAMES_H

#include "string_db.h"
#include "core/string_db.h"

class CoreStringNames {

Expand Down
6 changes: 3 additions & 3 deletions core/dictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "dictionary.h"
#include "core/dictionary.h"

#include "safe_refcount.h"
#include "variant.h"
#include "core/safe_refcount.h"
#include "core/variant.h"

struct _DictionaryVariantHash {

Expand Down
6 changes: 3 additions & 3 deletions core/dictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
#ifndef DICTIONARY_H
#define DICTIONARY_H

#include "array.h"
#include "list.h"
#include "ustring.h"
#include "core/array.h"
#include "core/list.h"
#include "core/ustring.h"
class Variant;

struct DictionaryPrivate;
Expand Down
2 changes: 1 addition & 1 deletion core/dvector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "dvector.h"
#include "core/dvector.h"

Mutex *dvector_lock = NULL;

Expand Down
12 changes: 6 additions & 6 deletions core/dvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
#ifndef DVECTOR_H
#define DVECTOR_H

#include "os/copymem.h"
#include "os/memory.h"
#include "os/rw_lock.h"
#include "pool_allocator.h"
#include "safe_refcount.h"
#include "ustring.h"
#include "core/os/copymem.h"
#include "core/os/memory.h"
#include "core/os/rw_lock.h"
#include "core/pool_allocator.h"
#include "core/safe_refcount.h"
#include "core/ustring.h"

struct MemoryPool {

Expand Down
6 changes: 3 additions & 3 deletions core/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "engine.h"
#include "core/engine.h"

#include "version.h"
#include "version_hash.gen.h"
#include "core/version.h"
#include "core/version_hash.gen.h"

void Engine::set_iterations_per_second(int p_ips) {

Expand Down
8 changes: 4 additions & 4 deletions core/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
#ifndef ENGINE_H
#define ENGINE_H

#include "list.h"
#include "os/main_loop.h"
#include "ustring.h"
#include "vector.h"
#include "core/list.h"
#include "core/os/main_loop.h"
#include "core/ustring.h"
#include "core/vector.h"

class Engine {

Expand Down
4 changes: 2 additions & 2 deletions core/error_macros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "error_macros.h"
#include "core/error_macros.h"

#include "os/os.h"
#include "core/os/os.h"

bool _err_error_exists = false;

Expand Down
2 changes: 1 addition & 1 deletion core/event_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "event_queue.h"
#include "core/event_queue.h"

Error EventQueue::push_call(uint32_t p_instance_ID, const StringName &p_method, VARIANT_ARG_DECLARE) {

Expand Down
2 changes: 1 addition & 1 deletion core/event_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#ifndef EVENT_QUEUE_H
#define EVENT_QUEUE_H

#include "object.h"
#include "core/object.h"
/**
@author Juan Linietsky <[email protected]>
*/
Expand Down
2 changes: 1 addition & 1 deletion core/func_ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "func_ref.h"
#include "core/func_ref.h"

Variant FuncRef::call_func(const Variant **p_args, int p_argcount, Variant::CallError &r_error) {

Expand Down
2 changes: 1 addition & 1 deletion core/func_ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#ifndef FUNC_REF_H
#define FUNC_REF_H

#include "reference.h"
#include "core/reference.h"

class FuncRef : public Reference {

Expand Down
10 changes: 5 additions & 5 deletions core/global_constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "global_constants.h"
#include "core/global_constants.h"

#include "object.h"
#include "os/input_event.h"
#include "os/keyboard.h"
#include "variant.h"
#include "core/object.h"
#include "core/os/input_event.h"
#include "core/os/keyboard.h"
#include "core/variant.h"

struct _GlobalConstant {

Expand Down
2 changes: 1 addition & 1 deletion core/global_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#ifndef GLOBAL_CONSTANTS_H
#define GLOBAL_CONSTANTS_H

#include "string_db.h"
#include "core/string_db.h"

class GlobalConstants {
public:
Expand Down
Loading

0 comments on commit fbf3487

Please sign in to comment.