Ver código fonte

Use C++11 standard. NOTE: Do not use any of the new C++11 features for now. The only allowed keyword is alignof

Daniele Bartolini 12 anos atrás
pai
commit
d8524bdb55
2 arquivos alterados com 2 adições e 2 exclusões
  1. 1 1
      CMakeLists.txt
  2. 1 1
      src/core/mem/Allocator.h

+ 1 - 1
CMakeLists.txt

@@ -69,7 +69,7 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
 
 include_directories(${INCLUDES} ${CROWN_LUAJIT_INCLUDES})
 link_directories(${CROWN_LUAJIT_LIBS})
-add_definitions(-pipe -ansi -W -Wall -Wextra -Wno-long-long -Wno-variadic-macros -fPIC -g -pg)
+add_definitions(-pipe -std=c++11 -W -Wall -Wextra -Wno-long-long -Wno-variadic-macros -fPIC -g -pg)
 
 # add build directories
 add_subdirectory(src)

+ 1 - 1
src/core/mem/Allocator.h

@@ -78,7 +78,7 @@ void call_destructor_and_deallocate(Allocator& a, T* ptr)
 /// @note
 /// @a allocator must be a reference to an existing allocator.
 #define CE_NEW(allocator, T)\
-	new ((allocator).allocate(sizeof(T))) T
+	new ((allocator).allocate(sizeof(T), alignof(T))) T
 
 /// Calls destructor on @a ptr and deallocates memory using the
 /// given @a allocator.