Commit 9d206a29 authored by fbarchard@google.com's avatar fbarchard@google.com

cygwin compatibility fix for ifdef underscores, and __inline for C vs inline which is C++

BUG=none
TEST=none
Review URL: http://webrtc-codereview.appspot.com/335003

git-svn-id: http://libyuv.googlecode.com/svn/trunk@115 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent aebc4304
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 114
Version: 115
License: BSD
License File: LICENSE
......
......@@ -29,7 +29,7 @@ static const int kCpuInitialized = 8;
// Detect CPU has SSE2 etc.
// test_flag parameter should be one of kCpuHas constants above
// returns non-zero if instruction set is detected
static inline int TestCpuFlag(int test_flag) {
static __inline int TestCpuFlag(int test_flag) {
extern int cpu_info_;
extern int InitCpuFlags();
return (cpu_info_ ? cpu_info_ : InitCpuFlags()) & test_flag;
......
......@@ -30,7 +30,7 @@ namespace libyuv {
extern "C" {
#endif
static inline uint8 Clip(int32 val) {
static __inline uint8 Clip(int32 val) {
if (val < 0) {
return (uint8) 0;
} else if (val > 255){
......
......@@ -22,7 +22,7 @@
// TODO(fbarchard): Use cpuid.h when gcc 4.4 is used on OSX and Linux.
#if (defined(__pic__) || defined(__APPLE__)) && defined(__i386__)
static inline void __cpuid(int cpu_info[4], int info_type) {
static __inline void __cpuid(int cpu_info[4], int info_type) {
asm volatile (
"mov %%ebx, %%edi \n"
"cpuid \n"
......@@ -32,7 +32,7 @@ static inline void __cpuid(int cpu_info[4], int info_type) {
);
}
#elif defined(__i386__) || defined(__x86_64__)
static inline void __cpuid(int cpu_info[4], int info_type) {
static __inline void __cpuid(int cpu_info[4], int info_type) {
asm volatile (
"cpuid \n"
: "=a"(cpu_info[0]), "=b"(cpu_info[1]), "=c"(cpu_info[2]), "=d"(cpu_info[3])
......
......@@ -107,14 +107,14 @@ void RAWToUVRow_C(const uint8* src_argb, int src_stride_argb,
ARGBToUVRow_C(row, kMaxStride, dst_u, dst_v, pix);
}
static inline int RGBToY(uint8 r, uint8 g, uint8 b) {
static __inline int RGBToY(uint8 r, uint8 g, uint8 b) {
return (( 66 * r + 129 * g + 25 * b + 128) >> 8) + 16;
}
static inline int RGBToU(uint8 r, uint8 g, uint8 b) {
static __inline int RGBToU(uint8 r, uint8 g, uint8 b) {
return ((-38 * r - 74 * g + 112 * b + 128) >> 8) + 128;
}
static inline int RGBToV(uint8 r, uint8 g, uint8 b) {
static __inline int RGBToV(uint8 r, uint8 g, uint8 b) {
return ((112 * r - 94 * g - 18 * b + 128) >> 8) + 128;
}
......@@ -239,7 +239,7 @@ void I400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int pix) {
#define BG UG * 128 + VG * 128
#define BR UR * 128 + VR * 128
static inline uint32 Clip(int32 val) {
static __inline uint32 Clip(int32 val) {
if (val < 0) {
return (uint32) 0;
} else if (val > 255){
......@@ -248,7 +248,7 @@ static inline uint32 Clip(int32 val) {
return (uint32) val;
}
static inline void YuvPixel(uint8 y, uint8 u, uint8 v, uint8* rgb_buf,
static __inline void YuvPixel(uint8 y, uint8 u, uint8 v, uint8* rgb_buf,
int ashift, int rshift, int gshift, int bshift) {
int32 y1 = (static_cast<int32>(y) - 16) * YG;
uint32 b = Clip(static_cast<int32>((u * UB + v * VB) - (BB) + y1) >> 6);
......
......@@ -514,7 +514,8 @@ static void ScaleRowDown38_2_Int_NEON(const uint8* src_ptr, int src_stride,
!defined(YUV_DISABLE_ASM)
#if defined(_MSC_VER)
#define TALIGN16(t, var) __declspec(align(16)) t _ ## var
#elif (defined(__APPLE__) || defined(__MINGW32__)) && defined(__i386__)
#elif (defined(__APPLE__) || defined(__MINGW32__) || defined(__CYGWIN__)) && \
defined(__i386__)
#define TALIGN16(t, var) t var __attribute__((aligned(16)))
#else
#define TALIGN16(t, var) t _ ## var __attribute__((aligned(16)))
......@@ -3265,8 +3266,8 @@ static void ScalePlaneDown38(int src_width, int src_height,
}
}
inline static uint32 SumBox(int iboxwidth, int iboxheight,
int src_stride, const uint8* src_ptr) {
static __inline uint32 SumBox(int iboxwidth, int iboxheight,
int src_stride, const uint8* src_ptr) {
assert(iboxwidth > 0);
assert(iboxheight > 0);
uint32 sum = 0u;
......@@ -3292,7 +3293,7 @@ static void ScalePlaneBoxRow(int dst_width, int boxheight,
}
}
inline static uint32 SumPixels(int iboxwidth, const uint16* src_ptr) {
static __inline uint32 SumPixels(int iboxwidth, const uint16* src_ptr) {
assert(iboxwidth > 0);
uint32 sum = 0u;
for (int x = 0; x < iboxwidth; ++x) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment