diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-15 15:04:32 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-15 15:04:32 +0000 |
commit | b387864d3341fca140a7bb837e959834d35b0591 (patch) | |
tree | 0b985c4af6e28de64f04a29e66318449c6340425 /gpu/command_buffer | |
parent | abd02159f62aa7e6a585ece6f2af01fac4ca4fa1 (diff) | |
download | chromium_src-b387864d3341fca140a7bb837e959834d35b0591.zip chromium_src-b387864d3341fca140a7bb837e959834d35b0591.tar.gz chromium_src-b387864d3341fca140a7bb837e959834d35b0591.tar.bz2 |
Change the way _EXPORT macros look.
With the current setup, if you have a header file my_class.h
class BASE_EXPORT MyClass {
public:
void MyInlineMethod() { /* do stuff, inline */ }
};
then every cc file that includes my_class.h will have a public symbol
for MyInlineMethod (because inline methods need to be emitted to
every translation unit, and the linker sorts them out). With the
components build, the linker can't decide to drop these inline methods,
so every .so that uses this header file will have the same public symbol.
With this proposed change, the symbol will only be visible in the target
the header file belongs to, and it will be hidden in all other components.
That's cleaner, and it also prevents accident hidden dependencies (say
target A depends on B, and B depends on C. A accidentally uses an inline
function from a class in C. With this change, that would result in a linker
error, and an explicit dependency from A on C would have to be added).
Also add a missing CHROMEOS_IMPLEMENTATION define which went
unnoticed until now.
BUG=90078
TEST=Things still build.
TBR=ben, tony, viettrungluu, thestig, agl, willchan
Review URL: https://chromiumcodereview.appspot.com/10386108
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137130 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer')
-rw-r--r-- | gpu/command_buffer/client/gles2_c_lib_export.h | 4 | ||||
-rw-r--r-- | gpu/command_buffer/client/gles2_impl_export.h | 4 | ||||
-rw-r--r-- | gpu/command_buffer/common/gles2_utils_export.h | 4 |
3 files changed, 12 insertions, 0 deletions
diff --git a/gpu/command_buffer/client/gles2_c_lib_export.h b/gpu/command_buffer/client/gles2_c_lib_export.h index bccad52..bb401e5 100644 --- a/gpu/command_buffer/client/gles2_c_lib_export.h +++ b/gpu/command_buffer/client/gles2_c_lib_export.h @@ -16,7 +16,11 @@ #endif // defined(GLES2_C_LIB_IMPLEMENTATION) #else // defined(WIN32) +#if defined(GLES2_C_LIB_IMPLEMENTATION) #define GLES2_C_LIB_EXPORT __attribute__((visibility("default"))) +#else +#define GLES2_C_LIB_EXPORT +#endif #endif #else // defined(COMPONENT_BUILD) diff --git a/gpu/command_buffer/client/gles2_impl_export.h b/gpu/command_buffer/client/gles2_impl_export.h index 9bf1871..2971387 100644 --- a/gpu/command_buffer/client/gles2_impl_export.h +++ b/gpu/command_buffer/client/gles2_impl_export.h @@ -16,7 +16,11 @@ #endif // defined(GLES2_IMPL_IMPLEMENTATION) #else // defined(WIN32) +#if defined(GLES2_IMPL_IMPLEMENTATION) #define GLES2_IMPL_EXPORT __attribute__((visibility("default"))) +#else +#define GLES2_IMPL_EXPORT +#endif #endif #else // defined(COMPONENT_BUILD) diff --git a/gpu/command_buffer/common/gles2_utils_export.h b/gpu/command_buffer/common/gles2_utils_export.h index 4031e2e..e458514 100644 --- a/gpu/command_buffer/common/gles2_utils_export.h +++ b/gpu/command_buffer/common/gles2_utils_export.h @@ -16,7 +16,11 @@ #endif // defined(GLES2_UTILS_IMPLEMENTATION) #else // defined(WIN32) +#if defined(GLES2_UTILS_IMPLEMENTATION) #define GLES2_UTILS_EXPORT __attribute__((visibility("default"))) +#else +#define GLES2_UTILS_EXPORT +#endif #endif #else // defined(COMPONENT_BUILD) |