/* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include #include #include #include #include #include #include template static constexpr size_t CheckSizeHelper(size_t, size_t); template<> constexpr size_t CheckSizeHelper<4>(size_t size32, size_t size64) { return size32; } template<> constexpr size_t CheckSizeHelper<8>(size_t size32, size_t size64) { return size64; } template static void CheckTypeSize() { const size_t mySize = CheckSizeHelper(size32, size64); static_assert(sizeof(T) == mySize, "struct is the wrong size"); } void CheckSizes(void) { //Types defined in hardware.h CheckTypeSize(); CheckTypeSize(); //Types defined in sensors.h CheckTypeSize(); CheckTypeSize(); CheckTypeSize(); CheckTypeSize(); //Types defined in fb.h CheckTypeSize(); //Types defined in hwcomposer.h CheckTypeSize(); CheckTypeSize(); //Types defined in gralloc.h CheckTypeSize(); CheckTypeSize(); //Types defined in consumerir.h CheckTypeSize(); //Types defined in camera_common.h CheckTypeSize(); CheckTypeSize(); //Types defined in camera3.h CheckTypeSize(); }