From 36802bd18b7b4e8c87fa019c7e3068bee330d174 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 20 Nov 2014 11:31:17 -0800 Subject: C++11 compatibility. * Fix string literal concatenation to not be interpreted as UD literals. * Add constexpr compatibility for non-integral static members. * Use __typeof__ instead of typeof (should become decltype once this actually becomes C++11). * Add an appropriate cast for atomic_uintptr_t, since moving to C++11 means moving from to , which has better typechecking (hooray for not macros!). Bug: 18466763 Change-Id: I9561dcb2526578687819ff85421ba80d8e1a9694 --- services/camera/libcameraservice/api1/client2/Parameters.h | 6 ++++-- services/camera/libcameraservice/device1/CameraHardwareInterface.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'services/camera') diff --git a/services/camera/libcameraservice/api1/client2/Parameters.h b/services/camera/libcameraservice/api1/client2/Parameters.h index 815cc55..e4e9a92 100644 --- a/services/camera/libcameraservice/api1/client2/Parameters.h +++ b/services/camera/libcameraservice/api1/client2/Parameters.h @@ -19,11 +19,13 @@ #include +#include #include +#include #include #include #include -#include + #include #include #include @@ -187,7 +189,7 @@ struct Parameters { static const int MAX_INITIAL_PREVIEW_WIDTH = 1920; static const int MAX_INITIAL_PREVIEW_HEIGHT = 1080; // Aspect ratio tolerance - static const float ASPECT_RATIO_TOLERANCE = 0.001; + static const CONSTEXPR float ASPECT_RATIO_TOLERANCE = 0.001; // Full static camera info, object owned by someone else, such as // Camera2Device. diff --git a/services/camera/libcameraservice/device1/CameraHardwareInterface.h b/services/camera/libcameraservice/device1/CameraHardwareInterface.h index 6386838..1935c2b 100644 --- a/services/camera/libcameraservice/device1/CameraHardwareInterface.h +++ b/services/camera/libcameraservice/device1/CameraHardwareInterface.h @@ -588,7 +588,7 @@ private: #ifndef container_of #define container_of(ptr, type, member) ({ \ - const typeof(((type *) 0)->member) *__mptr = (ptr); \ + const __typeof__(((type *) 0)->member) *__mptr = (ptr); \ (type *) ((char *) __mptr - (char *)(&((type *)0)->member)); }) #endif -- cgit v1.1