diff options
author | Jerome Gaillard <jgaillard@google.com> | 2018-12-10 21:59:28 +0000 |
---|---|---|
committer | Jerome Gaillard <jgaillard@google.com> | 2018-12-10 21:59:28 +0000 |
commit | 33c601f0f325f31b89d106e5ebee37a68b2788f2 (patch) | |
tree | 193980a0cf3bc9789c35b25a67fb0a7233ddf54f | |
parent | 1eb122c45f87b303189c441fae3f18360c66a1b3 (diff) | |
download | dng_sdk-33c601f0f325f31b89d106e5ebee37a68b2788f2.tar.gz |
Enable libdng_sdk for Windowsandroid-o-mr1-iot-release-1.0.8android-o-mr1-iot-release-1.0.7
This is needed to use skia in Android Studio for Windows.
Changes include:
- Replacing in dng_pthread.cpp '&operator(...) { }' with '&operator(...);'
to prevent 'control reaches end of non-void function' errors
- Removing test of '_MSC_VER >= 1900' in dng_pthread.h as we use clang
for compilation which has a recent version of 'time.h' but fails the
test '_MSC_VER >= 1900'
Test: sdk build
Change-Id: I200d691378c5d3e7c1729b5f645766755aa3e296
-rw-r--r-- | Android.bp | 11 | ||||
-rw-r--r-- | source/dng_pthread.cpp | 6 | ||||
-rw-r--r-- | source/dng_pthread.h | 10 |
3 files changed, 14 insertions, 13 deletions
@@ -121,6 +121,17 @@ cc_library{ "-framework AppKit", ], }, + windows: { + enabled: true, + cflags: [ + "-D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR", + "-Wno-null-arithmetic", + "-Wno-sign-compare", + "-Wno-tautological-pointer-compare", + "-Wno-unknown-pragmas", + ], + static_libs: ["libcompiler_rt-extras"], + }, }, export_include_dirs: ["source"], diff --git a/source/dng_pthread.cpp b/source/dng_pthread.cpp index 0347856..58c9ed0 100644 --- a/source/dng_pthread.cpp +++ b/source/dng_pthread.cpp @@ -75,7 +75,7 @@ struct dng_pthread_mutex_impl void Lock() { ::EnterCriticalSection(&lock); } void Unlock() { ::LeaveCriticalSection(&lock); } private: - dng_pthread_mutex_impl &operator=(const dng_pthread_mutex_impl &) { } + dng_pthread_mutex_impl &operator=(const dng_pthread_mutex_impl &); dng_pthread_mutex_impl(const dng_pthread_mutex_impl &) { } }; @@ -95,7 +95,7 @@ struct dng_pthread_cond_impl // Non copyable private: - dng_pthread_cond_impl &operator=(const dng_pthread_cond_impl &) { } + dng_pthread_cond_impl &operator=(const dng_pthread_cond_impl &); dng_pthread_cond_impl(const dng_pthread_cond_impl &) { } }; @@ -122,7 +122,7 @@ namespace mutex->Unlock(); } private: - ScopedLock &operator=(const ScopedLock &) { } + ScopedLock &operator=(const ScopedLock &); ScopedLock(const ScopedLock &) { } }; diff --git a/source/dng_pthread.h b/source/dng_pthread.h index 4572e31..80c3d24 100644 --- a/source/dng_pthread.h +++ b/source/dng_pthread.h @@ -53,18 +53,8 @@ #endif -// Use the standard "timespec" struct as "dng_timespec" for VS2015 and above -// from <time.h>. Define "dng_timespec" as "timespec" otherwise. -#if _MSC_VER >= 1900 #include <time.h> #define dng_timespec timespec -#else -struct dng_timespec { - long tv_sec; - long tv_nsec; -}; -#define timespec dng_timespec -#endif #ifdef __cplusplus extern "C" |