Skip to content

Commit 5a54ace

Browse files
committed
Merge pull request opencv#9130 from alalek:android_define
2 parents e5fbb4f + a4a47b5 commit 5a54ace

File tree

25 files changed

+73
-73
lines changed

25 files changed

+73
-73
lines changed

3rdparty/carotene/src/channel_extract.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void extract2(const Size2D &size,
4949
{
5050
internal::assertSupportedConfiguration();
5151
#ifdef CAROTENE_NEON
52-
#ifndef ANDROID
52+
#ifndef __ANDROID__
5353
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
5454
#endif
5555
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
@@ -60,7 +60,7 @@ void extract2(const Size2D &size,
6060
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
6161
size_t sj = 0u, dj = 0u;
6262

63-
#ifndef ANDROID
63+
#ifndef __ANDROID__
6464
for (; dj < roiw32; sj += 64, dj += 32)
6565
{
6666
internal::prefetch(src + sj);
@@ -101,7 +101,7 @@ void extract3(const Size2D &size,
101101
{
102102
internal::assertSupportedConfiguration();
103103
#ifdef CAROTENE_NEON
104-
#ifndef ANDROID
104+
#ifndef __ANDROID__
105105
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
106106
#endif
107107
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
@@ -112,7 +112,7 @@ void extract3(const Size2D &size,
112112
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
113113
size_t sj = 0u, dj = 0u;
114114

115-
#ifndef ANDROID
115+
#ifndef __ANDROID__
116116
for (; dj < roiw32; sj += 96, dj += 32)
117117
{
118118
internal::prefetch(src + sj);
@@ -153,7 +153,7 @@ void extract4(const Size2D &size,
153153
{
154154
internal::assertSupportedConfiguration();
155155
#ifdef CAROTENE_NEON
156-
#ifndef ANDROID
156+
#ifndef __ANDROID__
157157
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
158158
#endif
159159
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
@@ -164,7 +164,7 @@ void extract4(const Size2D &size,
164164
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
165165
size_t sj = 0u, dj = 0u;
166166

167-
#ifndef ANDROID
167+
#ifndef __ANDROID__
168168
for (; dj < roiw32; sj += 128, dj += 32)
169169
{
170170
internal::prefetch(src + sj);

3rdparty/carotene/src/channels_combine.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ void combineYUYV(const Size2D &size,
240240
{
241241
internal::assertSupportedConfiguration();
242242
#ifdef CAROTENE_NEON
243-
#ifndef ANDROID
243+
#ifndef __ANDROID__
244244
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
245245
#endif
246246
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
@@ -253,7 +253,7 @@ void combineYUYV(const Size2D &size,
253253
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
254254
size_t syj = 0u, sj = 0u, dj = 0u;
255255

256-
#ifndef ANDROID
256+
#ifndef __ANDROID__
257257
for (; sj < roiw32; sj += 32, syj += 64, dj += 128)
258258
{
259259
internal::prefetch(srcy + syj);
@@ -317,7 +317,7 @@ void combineUYVY(const Size2D &size,
317317
{
318318
internal::assertSupportedConfiguration();
319319
#ifdef CAROTENE_NEON
320-
#ifndef ANDROID
320+
#ifndef __ANDROID__
321321
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
322322
#endif
323323
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
@@ -330,7 +330,7 @@ void combineUYVY(const Size2D &size,
330330
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
331331
size_t syj = 0u, sj = 0u, dj = 0u;
332332

333-
#ifndef ANDROID
333+
#ifndef __ANDROID__
334334
for (; sj < roiw32; sj += 32, syj += 64, dj += 128)
335335
{
336336
internal::prefetch(srcy + syj);

3rdparty/carotene/src/flip.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ void flip3(const Size2D & size,
105105
{
106106
using namespace internal;
107107

108-
#ifndef ANDROID
108+
#ifndef __ANDROID__
109109
typedef typename VecTraits<T, 3>::vec128 vec128;
110110
#endif
111111
typedef typename VecTraits<T, 3>::vec64 vec64;
112112

113-
#ifndef ANDROID
113+
#ifndef __ANDROID__
114114
u32 step_base = 16 / sizeof(T), step_base3 = step_base * 3;
115115
size_t roiw_base = size.width >= (step_base - 1) ? size.width - step_base + 1 : 0;
116116
#endif
@@ -123,7 +123,7 @@ void flip3(const Size2D & size,
123123
T * dst = getRowPtr((T *)dstBase, dstStride, (flipMode & FLIP_VERTICAL_MODE) != 0 ? size.height - i - 1 : i);
124124
size_t j = 0, js = 0, jd = size.width * 3;
125125

126-
#ifndef ANDROID
126+
#ifndef __ANDROID__
127127
for (; j < roiw_base; j += step_base, js += step_base3, jd -= step_base3)
128128
{
129129
prefetch(src + js);
@@ -139,7 +139,7 @@ void flip3(const Size2D & size,
139139

140140
vst3q(dst + jd - step_base3, v_dst);
141141
}
142-
#endif // ANDROID
142+
#endif // __ANDROID__
143143

144144
for (; j < roiw_tail; j += step_tail, js += step_tail3, jd -= step_tail3)
145145
{

3rdparty/carotene/src/resize.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
359359
}
360360
else //if ((wr == 4.0f) && (hr == 4.0f)) //the only scale that lasts after isSupported check
361361
{
362-
#ifndef ANDROID
362+
#ifndef __ANDROID__
363363
size_t roiw16 = dsize.width >= 15 ? dsize.width - 15 : 0;
364364
#endif
365365
size_t roiw8 = dsize.width >= 7 ? dsize.width - 7 : 0;
@@ -373,7 +373,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
373373
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
374374
size_t sj = 0, dj = 0;
375375

376-
#ifndef ANDROID
376+
#ifndef __ANDROID__
377377
for ( ; dj < roiw16; dj += 16, sj += 64)
378378
{
379379
internal::prefetch(src0_row + sj);
@@ -450,7 +450,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
450450
{
451451
if ((wr == 2.0f) && (hr == 2.0f))
452452
{
453-
#ifndef ANDROID
453+
#ifndef __ANDROID__
454454
size_t roiw4 = dsize.width >= 3 ? (dsize.width - 3) << 2 : 0;
455455
#endif
456456
size_t roiw2 = dsize.width >= 1 ? (dsize.width - 1) << 2 : 0;
@@ -462,7 +462,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
462462
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
463463
size_t sj = 0, dj = 0;
464464

465-
#ifndef ANDROID
465+
#ifndef __ANDROID__
466466
for ( ; dj < roiw4; dj += 16, sj += 32)
467467
{
468468
internal::prefetch(src0_row + sj);
@@ -537,7 +537,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
537537
}
538538
else if ((wr == 0.5f) && (hr == 0.5f))
539539
{
540-
#ifndef ANDROID
540+
#ifndef __ANDROID__
541541
size_t roiw32 = dsize.width >= 31 ? (dsize.width - 31) << 2 : 0;
542542
#endif
543543
size_t roiw16 = dsize.width >= 15 ? (dsize.width - 15) << 2 : 0;
@@ -549,7 +549,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
549549
u8 * dst1_row = internal::getRowPtr(dstBase, dstStride, std::min(i + 1, dsize.height - 1));
550550
size_t sj = 0, dj = 0;
551551

552-
#ifndef ANDROID
552+
#ifndef __ANDROID__
553553
for ( ; dj < roiw32; dj += 128, sj += 64)
554554
{
555555
internal::prefetch(src_row + sj);
@@ -758,7 +758,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
758758
{
759759
if ((wr == 2.0f) && (wr == 2.0f))
760760
{
761-
#ifndef ANDROID
761+
#ifndef __ANDROID__
762762
size_t roiw16 = dsize.width >= 15 ? (dsize.width - 15) * 3 : 0;
763763
#endif
764764
size_t roiw8 = dsize.width >= 7 ? (dsize.width - 7) * 3 : 0;
@@ -770,7 +770,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
770770
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
771771
size_t sj = 0, dj = 0;
772772

773-
#ifndef ANDROID
773+
#ifndef __ANDROID__
774774
for ( ; dj < roiw16; dj += 48, sj += 96)
775775
{
776776
internal::prefetch(src0_row + sj);
@@ -856,7 +856,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
856856
}
857857
else if ((wr == 0.5f) && (hr == 0.5f))
858858
{
859-
#ifndef ANDROID
859+
#ifndef __ANDROID__
860860
size_t roiw32 = dsize.width >= 31 ? (dsize.width - 31) * 3 : 0;
861861
#endif
862862
size_t roiw16 = dsize.width >= 15 ? (dsize.width - 15) * 3 : 0;
@@ -868,7 +868,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
868868
u8 * dst1_row = internal::getRowPtr(dstBase, dstStride, std::min(i + 1, dsize.height - 1));
869869
size_t sj = 0, dj = 0;
870870

871-
#ifndef ANDROID
871+
#ifndef __ANDROID__
872872
for ( ; dj < roiw32; dj += 96, sj += 48)
873873
{
874874
internal::prefetch(src_row + sj);
@@ -928,7 +928,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
928928
}
929929
else //if ((hr == 4.0f) && (wr == 4.0f)) //the only scale that lasts after isSupported check
930930
{
931-
#ifndef ANDROID
931+
#ifndef __ANDROID__
932932
size_t roiw8 = dsize.width >= 7 ? (dsize.width - 7) * 3 : 0;
933933
#endif
934934

@@ -941,7 +941,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
941941
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
942942
size_t sj = 0, dj = 0;
943943

944-
#ifndef ANDROID
944+
#ifndef __ANDROID__
945945
for ( ; dj < roiw8; dj += 24, sj += 96)
946946
{
947947
internal::prefetch(src0_row + sj);

modules/core/src/opengl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,7 @@ void cv::ogl::render(const ogl::Arrays& arr, InputArray indices, int mode, Scala
15901590
#endif // HAVE_OPENCL
15911591

15921592
#if defined(HAVE_OPENGL)
1593-
# if defined(ANDROID)
1593+
# if defined(__ANDROID__)
15941594
# include <EGL/egl.h>
15951595
# elif defined(__linux__)
15961596
# include <GL/glx.h>
@@ -1659,7 +1659,7 @@ Context& initializeContextFromGL()
16591659
CL_CONTEXT_PLATFORM, (cl_context_properties)platforms[i],
16601660
CL_GL_CONTEXT_KHR, (cl_context_properties)wglGetCurrentContext(),
16611661
CL_WGL_HDC_KHR, (cl_context_properties)wglGetCurrentDC(),
1662-
#elif defined(ANDROID)
1662+
#elif defined(__ANDROID__)
16631663
CL_CONTEXT_PLATFORM, (cl_context_properties)platforms[i],
16641664
CL_GL_CONTEXT_KHR, (cl_context_properties)eglGetCurrentContext(),
16651665
CL_EGL_DISPLAY_KHR, (cl_context_properties)eglGetCurrentDisplay(),

modules/core/src/parallel.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
#include <unistd.h>
5757
#include <stdio.h>
5858
#include <sys/types.h>
59-
#if defined ANDROID
59+
#if defined __ANDROID__
6060
#include <sys/sysconf.h>
6161
#elif defined __APPLE__
6262
#include <sys/sysctl.h>
@@ -590,7 +590,7 @@ int cv::getThreadNum(void)
590590
#endif
591591
}
592592

593-
#ifdef ANDROID
593+
#ifdef __ANDROID__
594594
static inline int getNumberOfCPUsImpl()
595595
{
596596
FILE* cpuPossible = fopen("/sys/devices/system/cpu/possible", "r");
@@ -641,7 +641,7 @@ int cv::getNumberOfCPUs(void)
641641
#endif
642642

643643
return (int)sysinfo.dwNumberOfProcessors;
644-
#elif defined ANDROID
644+
#elif defined __ANDROID__
645645
static int ncpus = getNumberOfCPUsImpl();
646646
return ncpus;
647647
#elif defined __linux__

modules/core/src/parallel_pthreads.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ void ThreadManager::setNumOfThreads(size_t n)
527527

528528
size_t ThreadManager::defaultNumberOfThreads()
529529
{
530-
#ifdef ANDROID
530+
#ifdef __ANDROID__
531531
// many modern phones/tables have 4-core CPUs. Let's use no more
532532
// than 2 threads by default not to overheat the devices
533533
const unsigned int default_number_of_threads = 2;

modules/core/src/stat.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,7 +2177,7 @@ static bool ocl_minMaxIdx( InputArray _src, double* minVal, double* maxVal, int*
21772177
{
21782178
const ocl::Device & dev = ocl::Device::getDefault();
21792179

2180-
#ifdef ANDROID
2180+
#ifdef __ANDROID__
21812181
if (dev.isNVidia())
21822182
return false;
21832183
#endif
@@ -2971,7 +2971,7 @@ static bool ocl_norm( InputArray _src, int normType, InputArray _mask, double &
29712971
{
29722972
const ocl::Device & d = ocl::Device::getDefault();
29732973

2974-
#ifdef ANDROID
2974+
#ifdef __ANDROID__
29752975
if (d.isNVidia())
29762976
return false;
29772977
#endif
@@ -3313,7 +3313,7 @@ namespace cv {
33133313

33143314
static bool ocl_norm( InputArray _src1, InputArray _src2, int normType, InputArray _mask, double & result )
33153315
{
3316-
#ifdef ANDROID
3316+
#ifdef __ANDROID__
33173317
if (ocl::Device::getDefault().isNVidia())
33183318
return false;
33193319
#endif

modules/core/src/system.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,16 @@ Mutex* __initialization_mutex_initializer = &getInitializationMutex();
6666
# endif
6767
#endif
6868

69-
#if defined ANDROID || defined __linux__ || defined __FreeBSD__
69+
#if defined __ANDROID__ || defined __linux__ || defined __FreeBSD__
7070
# include <unistd.h>
7171
# include <fcntl.h>
7272
# include <elf.h>
73-
#if defined ANDROID || defined __linux__
73+
#if defined __ANDROID__ || defined __linux__
7474
# include <linux/auxvec.h>
7575
#endif
7676
#endif
7777

78-
#if defined ANDROID && defined HAVE_CPUFEATURES
78+
#if defined __ANDROID__ && defined HAVE_CPUFEATURES
7979
# include <cpu-features.h>
8080
#endif
8181

@@ -206,12 +206,12 @@ std::wstring GetTempFileNameWinRT(std::wstring prefix)
206206
#include <unistd.h>
207207
#include <stdio.h>
208208
#include <sys/types.h>
209-
#if defined ANDROID
209+
#if defined __ANDROID__
210210
#include <sys/sysconf.h>
211211
#endif
212212
#endif
213213

214-
#ifdef ANDROID
214+
#ifdef __ANDROID__
215215
# include <android/log.h>
216216
#endif
217217

@@ -833,7 +833,7 @@ String tempfile( const char* suffix )
833833
fname = temp_file;
834834
#endif
835835
# else
836-
# ifdef ANDROID
836+
# ifdef __ANDROID__
837837
//char defaultTemplate[] = "/mnt/sdcard/__opencv_temp.XXXXXX";
838838
char defaultTemplate[] = "/data/local/tmp/__opencv_temp.XXXXXX";
839839
# else

modules/core/test/ocl/test_arithm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ OCL_TEST_P(Mul, Mat_Scale)
331331
OCL_OFF(cv::multiply(src1_roi, src2_roi, dst1_roi, val[0]));
332332
OCL_ON(cv::multiply(usrc1_roi, usrc2_roi, udst1_roi, val[0]));
333333

334-
#ifdef ANDROID
334+
#ifdef __ANDROID__
335335
Near(udst1_roi.depth() >= CV_32F ? 2e-1 : 1);
336336
#else
337337
Near(udst1_roi.depth() >= CV_32F ? 1e-3 : 1);

0 commit comments

Comments
 (0)