From 9f84a74302fdd8d0b8ef6c65cd8674e816e3055f Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Mon, 4 Feb 2019 15:24:30 +0000 Subject: [PATCH] Ensure visibility of std namespace symbols are hidden with later versions of GCC Change-Id: If18e4e8c4244ddb5261e2a7190327b5129578b87 --- dali/devel-api/common/map-wrapper.h | 47 ++++++++++++++++----------------- dali/devel-api/common/set-wrapper.h | 47 ++++++++++++++++----------------- dali/public-api/common/vector-wrapper.h | 24 ++++++++--------- 3 files changed, 57 insertions(+), 61 deletions(-) diff --git a/dali/devel-api/common/map-wrapper.h b/dali/devel-api/common/map-wrapper.h index dc363c1..c02dd39 100644 --- a/dali/devel-api/common/map-wrapper.h +++ b/dali/devel-api/common/map-wrapper.h @@ -1,8 +1,8 @@ -#ifndef __DALI_MAP_H__ -#define __DALI_MAP_H__ +#ifndef DALI_MAP_WRAPPER_H +#define DALI_MAP_WRAPPER_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * 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. @@ -18,16 +18,17 @@ * */ -// EXTERNAL INCLUDES -#include - - #ifndef HIDE_DALI_INTERNALS -# include +#include #else +// Ensure that default visibility is used with any class that is used as an exception type +#include +#include +#include + #if defined(__clang__) #undef _LIBCPP_INLINE_VISIBILITY @@ -44,22 +45,20 @@ #else -// ensure that default visibility is used with any class that is used as an exception type -# include -# include -# include - -# include -# include -# undef _GLIBCXX_VISIBILITY_ATTR -# define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ ("hidden"))) -# include -# undef _GLIBCXX_VISIBILITY_ATTR -# define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V))) // restore `_GLIBCXX_VISIBILITY_ATTR` - -#endif //ifdef __clang__ +#include +#include +#undef _GLIBCXX_VISIBILITY_ATTR +#undef _GLIBCXX_VISIBILITY +#define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ ("hidden"))) +#define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ ("hidden"))) +#include +#undef _GLIBCXX_VISIBILITY_ATTR +#undef _GLIBCXX_VISIBILITY +#define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V))) // restore `_GLIBCXX_VISIBILITY_ATTR` +#define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V))) // restore `_GLIBCXX_VISIBILITY` -#endif //ifndef HIDE_DALI_INTERNALS +#endif // #ifdef __clang__ +#endif // #ifndef HIDE_DALI_INTERNALS -#endif /* __DALI_MAP_H__ */ +#endif // DALI_MAP_WRAPPER_H diff --git a/dali/devel-api/common/set-wrapper.h b/dali/devel-api/common/set-wrapper.h index e2eb2a3..13ad9f1 100644 --- a/dali/devel-api/common/set-wrapper.h +++ b/dali/devel-api/common/set-wrapper.h @@ -1,8 +1,8 @@ -#ifndef __DALI_SET_H__ -#define __DALI_SET_H__ +#ifndef DALI_SET_WRAPPER_H +#define DALI_SET_WRAPPER_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * 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. @@ -18,15 +18,17 @@ * */ - -// EXTERNAL INCLUDES - #ifndef HIDE_DALI_INTERNALS -# include +#include #else +// Ensure that default visibility is used with any class that is used as an exception type +#include +#include +#include + #if defined(__clang__) #undef _LIBCPP_INLINE_VISIBILITY @@ -43,23 +45,20 @@ #else +#include +#include +#undef _GLIBCXX_VISIBILITY_ATTR +#undef _GLIBCXX_VISIBILITY +#define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ ("hidden"))) +#define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ ("hidden"))) +#include +#undef _GLIBCXX_VISIBILITY_ATTR +#undef _GLIBCXX_VISIBILITY +#define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V))) // restore `_GLIBCXX_VISIBILITY_ATTR` +#define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V))) // restore `_GLIBCXX_VISIBILITY` -// ensure that default visibility is used with any class that is used as an exception type -# include -# include -# include - - -# include -# include -# undef _GLIBCXX_VISIBILITY_ATTR -# define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ ("hidden"))) -# include -# undef _GLIBCXX_VISIBILITY_ATTR -# define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V))) // restore `_GLIBCXX_VISIBILITY_ATTR` - -#endif //ifdef __clang__ +#endif // #ifdef __clang__ -#endif //ifndef HIDE_DALI_INTERNALS +#endif // #ifndef HIDE_DALI_INTERNALS -#endif /* __DALI_SET_H__ */ +#endif // DALI_SET_WRAPPER_H diff --git a/dali/public-api/common/vector-wrapper.h b/dali/public-api/common/vector-wrapper.h index 05d6b6c..accc2db 100644 --- a/dali/public-api/common/vector-wrapper.h +++ b/dali/public-api/common/vector-wrapper.h @@ -1,8 +1,8 @@ -#ifndef __VECTOR_WRAPPER_H__ -#define __VECTOR_WRAPPER_H__ +#ifndef DALI_VECTOR_WRAPPER_H +#define DALI_VECTOR_WRAPPER_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * 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. @@ -18,19 +18,13 @@ * */ -// EXTERNAL INCLUDES -#include - -// INTERNAL INCLUDES -#include - #ifndef HIDE_DALI_INTERNALS #include #else -// ensure that default visibility is used with any class that is used as an exception type +// Ensure that default visibility is used with any class that is used as an exception type #include #include #include @@ -53,13 +47,17 @@ #include #undef _GLIBCXX_VISIBILITY_ATTR +#undef _GLIBCXX_VISIBILITY #define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ ("hidden"))) +#define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ ("hidden"))) #include #undef _GLIBCXX_VISIBILITY_ATTR +#undef _GLIBCXX_VISIBILITY #define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V))) // restore `_GLIBCXX_VISIBILITY_ATTR` +#define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V))) // restore `_GLIBCXX_VISIBILITY` -#endif //ifdef __clang__ +#endif // #ifdef __clang__ -#endif //ifndef HIDE_DALI_INTERNALS +#endif // #ifndef HIDE_DALI_INTERNALS -#endif /* __VECTOR_WRAPPER__H__ */ +#endif // DALI_VECTOR_WRAPPER_H -- 2.7.4