Clean up ANDROID macro definitions [system_wrapper]

Review URL: http://webrtc-codereview.appspot.com/94001

git-svn-id: http://webrtc.googlecode.com/svn/trunk@257 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
leozwang@google.com
2011-07-26 17:29:38 +00:00
parent 13955743b0
commit b352700ff7
6 changed files with 28 additions and 38 deletions

View File

@@ -1,4 +1,10 @@
# This file is generated by gyp; do not edit. This means you! # Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
LOCAL_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
@@ -8,7 +14,6 @@ LOCAL_ARM_MODE := arm
LOCAL_MODULE := libwebrtc_system_wrappers LOCAL_MODULE := libwebrtc_system_wrappers
LOCAL_MODULE_TAGS := optional LOCAL_MODULE_TAGS := optional
LOCAL_CPP_EXTENSION := .cc LOCAL_CPP_EXTENSION := .cc
LOCAL_GENERATED_SOURCES :=
LOCAL_SRC_FILES := \ LOCAL_SRC_FILES := \
map.cc \ map.cc \
rw_lock_generic.cc \ rw_lock_generic.cc \
@@ -33,35 +38,20 @@ LOCAL_SRC_FILES := \
trace_linux.cc \ trace_linux.cc \
rw_lock_linux.cc rw_lock_linux.cc
# Flags passed to both C and C++ files. LOCAL_CFLAGS := \
MY_CFLAGS := $(MY_WEBRTC_COMMON_DEFS)
MY_CFLAGS_C :=
MY_DEFS := '-DNO_TCMALLOC' \
'-DNO_HEAPCHECKER' \
'-DWEBRTC_TARGET_PC' \
'-DWEBRTC_LINUX' \
'-DWEBRTC_CLOCK_TYPE_REALTIME' \
'-DWEBRTC_THREAD_RR' \
'-DWEBRTC_ANDROID' \
'-DANDROID'
LOCAL_CFLAGS := $(MY_CFLAGS_C) $(MY_CFLAGS) $(MY_DEFS)
# Include paths placed before CFLAGS/CPPFLAGS LOCAL_C_INCLUDES := \
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../.. \ $(LOCAL_PATH)/../.. \
$(LOCAL_PATH)/spreadsortlib \ $(LOCAL_PATH)/../interface \
$(LOCAL_PATH)/../interface $(LOCAL_PATH)/spreadsortlib
# Flags passed to only C++ (and not C) files. LOCAL_SHARED_LIBRARIES := \
LOCAL_CPPFLAGS := libcutils \
LOCAL_LDFLAGS :=
LOCAL_STATIC_LIBRARIES :=
LOCAL_SHARED_LIBRARIES := libcutils \
libdl \ libdl \
libstlport libstlport
LOCAL_ADDITIONAL_DEPENDENCIES :=
ifndef NDK_ROOT
include external/stlport/libstlport.mk include external/stlport/libstlport.mk
endif
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)

View File

@@ -13,7 +13,7 @@
#include <assert.h> #include <assert.h>
#include <memory.h> #include <memory.h>
#ifdef ANDROID #ifdef WEBRTC_ANDROID
#include <stdlib.h> #include <stdlib.h>
#endif #endif

View File

@@ -20,7 +20,7 @@
#include "cpu_mac.h" #include "cpu_mac.h"
#elif defined(WEBRTC_MAC_INTEL) #elif defined(WEBRTC_MAC_INTEL)
#include "cpu_mac.h" #include "cpu_mac.h"
#elif defined(ANDROID) #elif defined(WEBRTC_ANDROID)
// Not implemented yet, might be possible to use Linux implementation // Not implemented yet, might be possible to use Linux implementation
#else // defined(WEBRTC_LINUX) #else // defined(WEBRTC_LINUX)
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
@@ -43,7 +43,7 @@ WebRtc_UWord32 CpuWrapper::DetectNumberOfCores()
WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1, WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1,
"Available number of cores:%d", _numberOfCores); "Available number of cores:%d", _numberOfCores);
#elif defined(WEBRTC_LINUX) && !defined(ANDROID) #elif defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID)
_numberOfCores = get_nprocs(); _numberOfCores = get_nprocs();
WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1, WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1,
"Available number of cores:%d", _numberOfCores); "Available number of cores:%d", _numberOfCores);
@@ -78,7 +78,7 @@ CpuWrapper* CpuWrapper::CreateCpu()
return new CpuWindows(); return new CpuWindows();
#elif (defined(WEBRTC_MAC) || defined(WEBRTC_MAC_INTEL)) #elif (defined(WEBRTC_MAC) || defined(WEBRTC_MAC_INTEL))
return new CpuWrapperMac(); return new CpuWrapperMac();
#elif defined(ANDROID) #elif defined(WEBRTC_ANDROID)
return 0; return 0;
#else #else
return new CpuLinux(); return new CpuLinux();

View File

@@ -14,7 +14,7 @@
#if defined(_WIN32) #if defined(_WIN32)
#include "rw_lock_windows.h" #include "rw_lock_windows.h"
#elif defined(ANDROID) #elif defined(WEBRTC_ANDROID)
#include <stdlib.h> #include <stdlib.h>
#include "rw_lock_generic.h" #include "rw_lock_generic.h"
#else #else
@@ -26,7 +26,7 @@ RWLockWrapper* RWLockWrapper::CreateRWLock()
{ {
#ifdef _WIN32 #ifdef _WIN32
RWLockWrapper* lock = new RWLockWindows(); RWLockWrapper* lock = new RWLockWindows();
#elif defined(ANDROID) #elif defined(WEBRTC_ANDROID)
RWLockWrapper* lock = new RWLockWrapperGeneric(); RWLockWrapper* lock = new RWLockWrapperGeneric();
#else #else
RWLockWrapper* lock = new RWLockLinux(); RWLockWrapper* lock = new RWLockLinux();

View File

@@ -35,7 +35,7 @@ extern "C"
} }
} }
#if (defined(WEBRTC_LINUX) && !defined(ANDROID)) #if (defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID))
static pid_t gettid() static pid_t gettid()
{ {
#if defined(__NR_gettid) #if defined(__NR_gettid)
@@ -86,7 +86,7 @@ ThreadLinux::ThreadLinux(ThreadRunFunction func, ThreadObj obj,
int ThreadLinux::Construct() int ThreadLinux::Construct()
{ {
int result = 0; int result = 0;
#if !defined(ANDROID) #if !defined(WEBRTC_ANDROID)
// Enable immediate cancellation if requested, see Shutdown() // Enable immediate cancellation if requested, see Shutdown()
result = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); result = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
if (result != 0) if (result != 0)
@@ -191,7 +191,7 @@ bool ThreadLinux::Start(unsigned int& /*threadID*/)
return true; return true;
} }
#if (defined(WEBRTC_LINUX) && !defined(ANDROID)) #if (defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID))
bool ThreadLinux::SetAffinity(const int* processorNumbers, bool ThreadLinux::SetAffinity(const int* processorNumbers,
const unsigned int amountOfProcessors) const unsigned int amountOfProcessors)
{ {
@@ -235,7 +235,7 @@ void ThreadLinux::SetNotAlive()
bool ThreadLinux::Shutdown() bool ThreadLinux::Shutdown()
{ {
#if !defined(ANDROID) #if !defined(WEBRTC_ANDROID)
if (_thread && (0 != pthread_cancel(_thread))) if (_thread && (0 != pthread_cancel(_thread)))
{ {
return false; return false;

View File

@@ -16,7 +16,7 @@
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#ifdef ANDROID #ifdef WEBRTC_ANDROID
#include <pthread.h> #include <pthread.h>
#else #else
#include <iostream> #include <iostream>