diff --git a/webrtc/common_types.h b/webrtc/common_types.h index 3a5b7f3dd..7e88666ab 100644 --- a/webrtc/common_types.h +++ b/webrtc/common_types.h @@ -8,10 +8,10 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_COMMON_TYPES_H -#define WEBRTC_COMMON_TYPES_H +#ifndef WEBRTC_COMMON_TYPES_H_ +#define WEBRTC_COMMON_TYPES_H_ -#include "typedefs.h" +#include "webrtc/typedefs.h" #if defined(_MSC_VER) // Disable "new behavior: elements of array will be default initialized" @@ -33,6 +33,16 @@ #define RTP_PAYLOAD_NAME_SIZE 32 +#if defined(WEBRTC_WIN) +// Compares two strings without regard to case. +#define STR_CASE_CMP(s1, s2) ::_stricmp(s1, s2) +// Compares characters of two strings without regard to case. +#define STR_NCASE_CMP(s1, s2, n) ::_strnicmp(s1, s2, n) +#else +#define STR_CASE_CMP(s1, s2) ::strcasecmp(s1, s2) +#define STR_NCASE_CMP(s1, s2, n) ::strncasecmp(s1, s2, n) +#endif + namespace webrtc { class Config; @@ -590,5 +600,8 @@ struct OverUseDetectorOptions { double initial_var_noise; double initial_threshold; }; + } // namespace webrtc -#endif // WEBRTC_COMMON_TYPES_H + +#endif // WEBRTC_COMMON_TYPES_H_ + diff --git a/webrtc/modules/audio_coding/main/source/acm_common_defs.h b/webrtc/modules/audio_coding/main/source/acm_common_defs.h index db901c1ea..b959eeb47 100644 --- a/webrtc/modules/audio_coding/main/source/acm_common_defs.h +++ b/webrtc/modules/audio_coding/main/source/acm_common_defs.h @@ -24,14 +24,6 @@ #error iSAC and iSACFX codecs cannot be enabled at the same time #endif -#ifdef WIN32 -// OS-dependent case-insensitive string comparison -#define STR_CASE_CMP(x, y) ::_stricmp(x, y) -#else -// OS-dependent case-insensitive string comparison -#define STR_CASE_CMP(x, y) ::strcasecmp(x, y) -#endif - namespace webrtc { // 60 ms is the maximum block size we support. An extra 20 ms is considered diff --git a/webrtc/modules/media_file/source/media_file_impl.cc b/webrtc/modules/media_file/source/media_file_impl.cc index 983a1e30c..e832791aa 100644 --- a/webrtc/modules/media_file/source/media_file_impl.cc +++ b/webrtc/modules/media_file/source/media_file_impl.cc @@ -16,14 +16,6 @@ #include "webrtc/system_wrappers/interface/tick_util.h" #include "webrtc/system_wrappers/interface/trace.h" -#if (defined(WIN32) || defined(WINCE)) - #define STR_CASE_CMP _stricmp - #define STR_NCASE_CMP _strnicmp -#else - #define STR_CASE_CMP strcasecmp - #define STR_NCASE_CMP strncasecmp -#endif - namespace webrtc { MediaFile* MediaFile::CreateMediaFile(const int32_t id) { diff --git a/webrtc/modules/media_file/source/media_file_utility.cc b/webrtc/modules/media_file/source/media_file_utility.cc index 44a48e342..04022ad62 100644 --- a/webrtc/modules/media_file/source/media_file_utility.cc +++ b/webrtc/modules/media_file/source/media_file_utility.cc @@ -23,14 +23,6 @@ #include "avi_file.h" #endif -#if (defined(WIN32) || defined(WINCE)) - #define STR_CASE_CMP _stricmp - #define STR_NCASE_CMP _strnicmp -#else - #define STR_CASE_CMP strcasecmp - #define STR_NCASE_CMP strncasecmp -#endif - namespace { enum WaveFormats { diff --git a/webrtc/modules/utility/source/coder.cc b/webrtc/modules/utility/source/coder.cc index 970c2367d..86ed6c45c 100644 --- a/webrtc/modules/utility/source/coder.cc +++ b/webrtc/modules/utility/source/coder.cc @@ -12,13 +12,6 @@ #include "webrtc/modules/interface/module_common_types.h" #include "webrtc/modules/utility/source/coder.h" -// OS independent case insensitive string comparison. -#ifdef WIN32 - #define STR_CASE_CMP(x,y) ::_stricmp(x,y) -#else - #define STR_CASE_CMP(x,y) ::strcasecmp(x,y) -#endif - namespace webrtc { AudioCoder::AudioCoder(uint32_t instanceID) : _acm(AudioCodingModule::Create(instanceID)), diff --git a/webrtc/modules/utility/source/file_player_impl.cc b/webrtc/modules/utility/source/file_player_impl.cc index db8437190..1a2b67498 100644 --- a/webrtc/modules/utility/source/file_player_impl.cc +++ b/webrtc/modules/utility/source/file_player_impl.cc @@ -17,13 +17,6 @@ #include "video_coder.h" #endif -// OS independent case insensitive string comparison. -#ifdef WIN32 - #define STR_CASE_CMP(x,y) ::_stricmp(x,y) -#else - #define STR_CASE_CMP(x,y) ::strcasecmp(x,y) -#endif - namespace webrtc { FilePlayer* FilePlayer::CreateFilePlayer(uint32_t instanceID, FileFormats fileFormat) diff --git a/webrtc/modules/utility/source/file_recorder_impl.cc b/webrtc/modules/utility/source/file_recorder_impl.cc index e9e5b98d7..16faa58d3 100644 --- a/webrtc/modules/utility/source/file_recorder_impl.cc +++ b/webrtc/modules/utility/source/file_recorder_impl.cc @@ -21,13 +21,6 @@ #include "video_frames_queue.h" #endif -// OS independent case insensitive string comparison. -#ifdef WIN32 - #define STR_CASE_CMP(x,y) ::_stricmp(x,y) -#else - #define STR_CASE_CMP(x,y) ::strcasecmp(x,y) -#endif - namespace webrtc { FileRecorder* FileRecorder::CreateFileRecorder(uint32_t instanceID, FileFormats fileFormat) diff --git a/webrtc/voice_engine/voice_engine_defines.h b/webrtc/voice_engine/voice_engine_defines.h index 2a904c7d0..42851d444 100644 --- a/webrtc/voice_engine/voice_engine_defines.h +++ b/webrtc/voice_engine/voice_engine_defines.h @@ -136,12 +136,6 @@ enum { kVoiceEngineMaxRtpExtensionId = 14 }; #define WEBRTC_VOICE_ENGINE_RX_NS_DEFAULT_MODE NoiseSuppression::kModerate // AudioProcessing RX NS mode -// Macros -// Comparison of two strings without regard to case -#define STR_CASE_CMP(x,y) ::_stricmp(x,y) -// Compares characters of two strings without regard to case -#define STR_NCASE_CMP(x,y,n) ::_strnicmp(x,y,n) - // ---------------------------------------------------------------------------- // Build information macros // ---------------------------------------------------------------------------- @@ -225,6 +219,8 @@ inline int VoEChannelId(int moduleId) #if defined(_WIN32) + #include + #pragma comment( lib, "winmm.lib" ) #ifndef WEBRTC_EXTERNAL_TRANSPORT @@ -235,13 +231,6 @@ inline int VoEChannelId(int moduleId) // Defines // ---------------------------------------------------------------------------- - #include - - // Comparison of two strings without regard to case - #define STR_CASE_CMP(x,y) ::_stricmp(x,y) - // Compares characters of two strings without regard to case - #define STR_NCASE_CMP(x,y,n) ::_strnicmp(x,y,n) - // Default device for Windows PC #define WEBRTC_VOICE_ENGINE_DEFAULT_DEVICE \ AudioDeviceModule::kDefaultCommunicationDevice