ref: 7ef2e9553ce4c8985a36fbf8d5927ce9e83fa2de
parent: cdada926d84b91ada0ba8394ff75382c9217c625
parent: 0acb780715f8ba5bae7a315669fd467cafda63a5
author: ruil2 <[email protected]>
date: Tue May 13 08:39:21 EDT 2014
Merge pull request #822 from mstorsjo/simplify-platform-defines Don't manually define MACOS and LINUX, use built-in defines instead
--- a/build/platform-android.mk
+++ b/build/platform-android.mk
@@ -35,7 +35,7 @@
CXX = $(TOOLCHAINPREFIX)g++
CC = $(TOOLCHAINPREFIX)gcc
AR = $(TOOLCHAINPREFIX)ar
-CFLAGS += -DLINUX -DANDROID_NDK -fpic --sysroot=$(SYSROOT)
+CFLAGS += -DANDROID_NDK -fpic --sysroot=$(SYSROOT)
CXXFLAGS += -fno-rtti -fno-exceptions
LDFLAGS += --sysroot=$(SYSROOT)
SHLDFLAGS = -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,-soname,lib$(PROJECT_NAME).so
--- a/build/platform-darwin.mk
+++ b/build/platform-darwin.mk
@@ -1,7 +1,7 @@
include build/platform-arch.mk
SHAREDLIBSUFFIX = dylib
SHARED = -dynamiclib
-CFLAGS += -Wall -fPIC -DMACOS -MMD -MP
+CFLAGS += -Wall -fPIC -MMD -MP
LDFLAGS += -lpthread
ifeq ($(ASM_ARCH), x86)
ASMFLAGS += -DPREFIX
--- a/build/platform-linux.mk
+++ b/build/platform-linux.mk
@@ -1,6 +1,6 @@
include build/platform-arch.mk
SHAREDLIBSUFFIX = so
-CFLAGS += -Wall -fno-strict-aliasing -fPIC -DLINUX -MMD -MP
+CFLAGS += -Wall -fno-strict-aliasing -fPIC -MMD -MP
LDFLAGS += -lpthread
ifeq ($(ASM_ARCH), x86)
ifeq ($(ENABLE64BIT), Yes)
--- a/codec/common/src/WelsThreadLib.cpp
+++ b/codec/common/src/WelsThreadLib.cpp
@@ -39,7 +39,7 @@
*/
-#ifdef LINUX
+#ifdef __linux__
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
@@ -450,7 +450,7 @@
#ifdef ANDROID_NDK
pInfo->ProcessorCount = android_getCpuCount();
return WELS_THREAD_ERROR_OK;
-#elif defined(LINUX)
+#elif defined(__linux__)
cpu_set_t cpuset;
@@ -472,7 +472,7 @@
return WELS_THREAD_ERROR_OK;
-#endif//LINUX
+#endif//__linux__
}
#endif