Exported things should always be visible This changes our COMPONENT_EXPORT macros to make the things they export visible all the time on non-windows, rather than making them visible in the named component only. This avoids subtle bugs where things defined in multiple components end up with one copy per component, only one of which is visible, and so the linker doesn't know it's supposed to dedup them. Some, but not all, of these issues are detected by the new clang warning -Wunique-object-duplication. This change addresses some instances of that warning firing on chromium code, but not all. Conversely, there are likely instances which the warning does not catch, which are fixed by this CL. Bug: 368047728 Change-Id: I829a9bd84e57e3c7d80ec33aea0408951019bde7 AX-Relnotes: n/a. Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6264795 Owners-Override: Avi Drissman <avi@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Commit-Queue: Devon Loehr <dloehr@google.com> Cr-Commit-Position: refs/heads/main@{#1456614} NOKEYCHECK=True GitOrigin-RevId: edf57482697bfb2777c28ab56977f5c448fa5c2d
diff --git a/dbus_export.h b/dbus_export.h index 1874aa9..029b7ec 100644 --- a/dbus_export.h +++ b/dbus_export.h
@@ -15,17 +15,9 @@ #endif // defined(WIN32) #if defined(COMPONENT_BUILD) - -#if defined(DBUS_IMPLEMENTATION) #define CHROME_DBUS_EXPORT __attribute__((visibility("default"))) -#else -#define CHROME_DBUS_EXPORT -#endif - #else // !defined(COMPONENT_BUILD) - #define CHROME_DBUS_EXPORT - #endif // defined(COMPONENT_BUILD) #endif // DBUS_DBUS_EXPORT_H_