From 63bb1f25c6ec0af614be5391ec0f1aca06e1d858 Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Wed, 5 Aug 2020 13:40:30 +0100 Subject: [PATCH] Remove DALI_COMPILE_TIME_ASSERT macro (use static_assert instead) Change-Id: If300adf97de686e9b65fa9ed97b5600c8109b5c1 --- dali/devel-api/object/property-helper-devel.h | 6 ++-- dali/public-api/common/compile-time-assert.h | 46 --------------------------- dali/public-api/dali-core.h | 1 - dali/public-api/file.list | 1 - dali/public-api/object/type-registry-helper.h | 7 ++-- 5 files changed, 6 insertions(+), 55 deletions(-) delete mode 100644 dali/public-api/common/compile-time-assert.h diff --git a/dali/devel-api/object/property-helper-devel.h b/dali/devel-api/object/property-helper-devel.h index f680306..fc93ecf 100644 --- a/dali/devel-api/object/property-helper-devel.h +++ b/dali/devel-api/object/property-helper-devel.h @@ -2,7 +2,7 @@ #define DALI_PROPERTY_HELPER_DEVEL_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,11 +29,11 @@ */ #define DALI_DEVEL_PROPERTY_REGISTRATION_INTERNAL( count, typeRegistrationObject, objectNamespace, objectType, develNamespace, text, valueType, enumIndex ) \ Dali::PropertyRegistration DALI_TOKEN_PASTE( property, count ) ( typeRegistrationObject, text, objectNamespace:: develNamespace ::Property::enumIndex, Dali::Property::valueType, &objectType::SetProperty, &objectType::GetProperty ); \ - DALI_COMPILE_TIME_ASSERT( ( objectNamespace:: develNamespace ::Property::enumIndex - objectNamespace::objectType::PROPERTY_START_INDEX ) == count ); + static_assert( ( objectNamespace:: develNamespace ::Property::enumIndex - objectNamespace::objectType::PROPERTY_START_INDEX ) == count ); #define DALI_DEVEL_PROPERTY_REGISTRATION_INTERNAL_READ_ONLY( count, typeRegistrationObject, objectNamespace, objectType, develNamespace, text, valueType, enumIndex ) \ Dali::PropertyRegistration DALI_TOKEN_PASTE( property, count ) ( typeRegistrationObject, text, objectNamespace:: develNamespace ::Property::enumIndex, Dali::Property::valueType, NULL, &objectType::GetProperty ); \ - DALI_COMPILE_TIME_ASSERT( ( objectNamespace:: develNamespace ::Property::enumIndex - objectNamespace::objectType::PROPERTY_START_INDEX ) == count ); + static_assert( ( objectNamespace:: develNamespace ::Property::enumIndex - objectNamespace::objectType::PROPERTY_START_INDEX ) == count ); /** * @brief These macros are used to define properties for implementations of CustomActor. diff --git a/dali/public-api/common/compile-time-assert.h b/dali/public-api/common/compile-time-assert.h deleted file mode 100644 index 7fd4098..0000000 --- a/dali/public-api/common/compile-time-assert.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef DALI_COMPILE_TIME_ASSERT_H -#define DALI_COMPILE_TIME_ASSERT_H - -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * 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. - * - */ - -// INTERNAL INCLUDES -#include - -// EXTERNAL INCLUDES -#include - -namespace Dali -{ -/** - * @addtogroup dali_core_common - * @{ - */ - -/** - * @brief Use DALI_COMPILE_TIME_ASSERT to test expressions at compile time. - * - * @SINCE_1_0.0 - */ -#define DALI_COMPILE_TIME_ASSERT( x ) static_assert( x, #x ); - -/** - * @} - */ -} // namespace Dali - -#endif // DALI_COMPILE_TIME_ASSERT_H diff --git a/dali/public-api/dali-core.h b/dali/public-api/dali-core.h index f9ee620..39fc2f1 100644 --- a/dali/public-api/dali-core.h +++ b/dali/public-api/dali-core.h @@ -37,7 +37,6 @@ #include #include -#include #include #include #include diff --git a/dali/public-api/file.list b/dali/public-api/file.list index 5aff7d8..e40a700 100644 --- a/dali/public-api/file.list +++ b/dali/public-api/file.list @@ -117,7 +117,6 @@ SET( public_api_core_animation_header_files SET( public_api_core_common_header_files - ${public_api_src_dir}/common/compile-time-assert.h ${public_api_src_dir}/common/constants.h ${public_api_src_dir}/common/dali-common.h ${public_api_src_dir}/common/dali-vector.h diff --git a/dali/public-api/object/type-registry-helper.h b/dali/public-api/object/type-registry-helper.h index 9c184aa..27b53fb 100644 --- a/dali/public-api/object/type-registry-helper.h +++ b/dali/public-api/object/type-registry-helper.h @@ -2,7 +2,7 @@ #define DALI_TYPE_REGISTRY_HELPER_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ */ // INTERNAL INCLUDES -#include #include /** @@ -33,11 +32,11 @@ #define DALI_PROPERTY_REGISTRATION_INTERNAL( count, typeRegistrationObject, objectNamespace, objectType, text, valueType, enumIndex ) \ Dali::PropertyRegistration DALI_TOKEN_PASTE( property, count ) ( typeRegistrationObject, text, objectNamespace::objectType::Property::enumIndex, Dali::Property::valueType, &objectType::SetProperty, &objectType::GetProperty ); \ - DALI_COMPILE_TIME_ASSERT( ( objectNamespace::objectType::Property::enumIndex - objectNamespace::objectType::PROPERTY_START_INDEX ) == count ); + static_assert( ( objectNamespace::objectType::Property::enumIndex - objectNamespace::objectType::PROPERTY_START_INDEX ) == count ); #define DALI_PROPERTY_REGISTRATION_INTERNAL_READ_ONLY( count, typeRegistrationObject, objectNamespace, objectType, text, valueType, enumIndex ) \ Dali::PropertyRegistration DALI_TOKEN_PASTE( property, count ) ( typeRegistrationObject, text, objectNamespace::objectType::Property::enumIndex, Dali::Property::valueType, NULL, &objectType::GetProperty ); \ - DALI_COMPILE_TIME_ASSERT( ( objectNamespace::objectType::Property::enumIndex - objectNamespace::objectType::PROPERTY_START_INDEX ) == count ); + static_assert( ( objectNamespace::objectType::Property::enumIndex - objectNamespace::objectType::PROPERTY_START_INDEX ) == count ); #define DALI_ANIMATABLE_PROPERTY_REGISTRATION_INTERNAL( count, typeRegistrationObject, objectNamespace, objectType, text, valueType, enumIndex) \ Dali::AnimatablePropertyRegistration DALI_TOKEN_PASTE( property, count ) ( typeRegistrationObject, text, objectNamespace::objectType::Property::enumIndex, Dali::Property::valueType ); -- 2.7.4