diff --git a/client/Makefile b/client/Makefile index 64543cf3..f58c3c86 100644 --- a/client/Makefile +++ b/client/Makefile @@ -24,13 +24,13 @@ ifeq ($(TARGET), ANDROID) # make ANDROID=1 CXX = $(NDK_DIR)/bin/arm-linux-androideabi-g++ STRIP = $(NDK_DIR)/bin/arm-linux-androideabi-strip -CXXFLAGS += -DANDROID -fPIC -DHAS_OPENSL -I/home/johannes/Develop/build/arm/include +CXXFLAGS += -DANDROID -DNO_CPP11_STRING -fPIC -DHAS_OPENSL -I/home/johannes/Develop/build/arm/include LDFLAGS = -L/home/johannes/Develop/build/arm/lib -pie -lFLAC -lOpenSLES OBJ += player/openslPlayer.o else ifeq ($(TARGET), OPENWRT) -CXXFLAGS += -DIS_BIG_ENDIAN -DNO_TO_STRING -DNO_STOUL -DNO_STOI -DHAS_OGG -DHAS_ALSA -DHAS_AVAHI -DHAS_DAEMON +CXXFLAGS += -DIS_BIG_ENDIAN -DNO_CPP11_STRING -DHAS_OGG -DHAS_ALSA -DHAS_AVAHI -DHAS_DAEMON LDFLAGS = -lasound -logg -lvorbisidec -lFLAC -lavahi-client -lavahi-common -latomic OBJ += player/alsaPlayer.o decoder/oggDecoder.o browseAvahi.o diff --git a/common/compat.h b/common/compat.h index 2b3d4d22..e23e2a0b 100644 --- a/common/compat.h +++ b/common/compat.h @@ -1,20 +1,11 @@ #ifndef COMPAT_H #define COMPAT_H -#ifdef ANDROID -#define NO_TO_STRING -#define NO_STOUL -#define NO_STOUL -#define NO_STOI -#endif #include -#ifdef NO_TO_STRING +#ifdef NO_CPP11_STRING #include -#endif - -#if defined(NO_STOUL) || defined(NO_STOI) #include #endif @@ -24,7 +15,7 @@ namespace cpt template static std::string to_string(const T& t) { - #ifdef NO_TO_STRING + #ifdef NO_CPP11_STRING std::stringstream ss; ss << t; return ss.str(); @@ -35,17 +26,16 @@ namespace cpt static long stoul(const std::string& s) { - #ifdef NO_STOUL + #ifdef NO_CPP11_STRING return atol(s.c_str()); #else return std::stoul(s); #endif } - static int stoi(const std::string& str) { - #ifdef NO_STOI + #ifdef NO_CPP11_STRING return strtol(str.c_str(), 0, 10); #else return std::stoi(str);