Skip to content

Commit

Permalink
Merge pull request #147 from martanoga/master
Browse files Browse the repository at this point in the history
Adjust to poor VS2012 c++11 conformance
  • Loading branch information
grzegorzmazur committed Nov 21, 2015
2 parents 876bc1c + 88c43e3 commit 5920cdb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ endif ()
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -std=c++11")
elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
add_definitions(-DYACAS_NO_CONSTEXPR -DYACAS_NO_ATOMIC_TYPES)
add_definitions(-DYACAS_NO_CONSTEXPR -DYACAS_NO_ATOMIC_TYPES -DYACAS_UINT32_T_IN_GLOBAL_NAMESPACE)
endif ()

if (${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten")
Expand Down
8 changes: 7 additions & 1 deletion src/commandline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "yacas/commandline.h"

#include <algorithm>
#include <cstdint>

namespace {
struct IsPrefix {
Expand Down Expand Up @@ -60,8 +61,13 @@ void CCommandLine::ReadLineSub(const std::string& prompt)

for (;;)
{
std::uint32_t c = GetKey();


#ifdef YACAS_UINT32_T_IN_GLOBAL_NAMESPACE
uint32_t c = GetKey();
#else
std::uint32_t c = GetKey();
#endif
const std::size_t len = utf8::distance(iSubLine.begin(), iSubLine.end());

switch (c)
Expand Down
8 changes: 7 additions & 1 deletion src/tokenizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "yacas/utf8.h"

#include <cstdint>

namespace {
static const char symbolics[] = "~`!@#$^&*-=+:<>?/\\|";
}
Expand All @@ -20,7 +22,11 @@ bool IsSymbolic(LispChar c)
const LispString* LispTokenizer::NextToken(LispInput& aInput,
LispHashTable& aHashTable)
{
std::uint32_t c;
#ifdef YACAS_UINT32_T_IN_GLOBAL_NAMESPACE
uint32_t c;
#else
std::uint32_t c;
#endif

// skip whitespaces and comments
for (;;) {
Expand Down

0 comments on commit 5920cdb

Please sign in to comment.