summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-04-22 14:49:06 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-04-23 08:10:55 +0200
commitf62cb40bdfaf41cf8e989640f9be79f652f30914 (patch)
tree080203e854cf857d6b11e864a0c9e5269202bb94 /include
parentc1d10276d32cbdaecf6894be723ab8d29cc7dbe2 (diff)
Remove dubious #pragma pack
...that were introduced with 21584b304b21bfe6b99b6f29018c6b754ea28fc0 "make OUString(OUStringLiteral) constructor constexpr", apparently to mimic the corresponding #pragma pack for rtl_uString in include/rtl/ustring.h. But neither of them appear to have any value: All struct member types involved (oslInterlockedCount aka sal_Int32, sal_Int32 itself, and sal_Unicode) have size <= 4, so the member alignment ("on a boundary that's either a multiple of [the pragma pack value], or a multiple of the size of the member, whichever is smaller", according to <https://docs.microsoft.com/en-us/cpp/preprocessor/pack?view=msvc-160>) is not affected. And neither are alignof(rtl_uString) and alignof(OUStringLiteral<N>) affected, which remain e.g. 4 on x86-64. (And prior to 21584b304b21bfe6b99b6f29018c6b754ea28fc0, OUStringLiteral did not have any pragma pack cargo cult, but which did not cause OUStringLiteral::assertLayout to fail, or raise any other documented issues.) So remove the pragma pack cargo cult again at least from OUStringLiteral. (And leave potential removal from rtl_uString for another commit.) Change-Id: I1a3626f0db1a0413ff792bd00ebaf76e4249b13f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114484 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'include')
-rw-r--r--include/rtl/ustring.hxx6
1 files changed, 0 insertions, 6 deletions
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index e1ae2d38f2d9..2699c09ac03f 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -115,9 +115,6 @@ private:
static_assert(offsetof(OUStringLiteral, str.buffer) == offsetof(OUStringLiteral, more.buffer));
}
-#if defined(_WIN32)
-#pragma pack(push, 4)
-#endif
union {
rtl_uString str;
struct {
@@ -131,9 +128,6 @@ private:
{} //TODO: drop initialization for C++20 (P1331R2)
};
};
-#if defined(_WIN32)
-#pragma pack(pop)
-#endif
};
#if defined RTL_STRING_UNITTEST