From aa7a86068134a983da7adae5dc77422ce08a9254 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 7 Sep 2023 01:02:15 +0300 Subject: [PATCH] Hide the delegating constructor of ZlibCompressed in the .cpp file MSVC has trouble with exporting the vftable if the main constructor is in a .cpp file but the delegating one is not. --- source/io/zlibcompressed.cpp | 4 ++++ source/io/zlibcompressed.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/io/zlibcompressed.cpp b/source/io/zlibcompressed.cpp index 8896f14..23922e6 100644 --- a/source/io/zlibcompressed.cpp +++ b/source/io/zlibcompressed.cpp @@ -38,6 +38,10 @@ ZlibCompressed::Private::Private() } +ZlibCompressed::ZlibCompressed(Base &b, unsigned level): + ZlibCompressed(b, b.get_mode()&M_RDWR, level) +{ } + ZlibCompressed::ZlibCompressed(Base &b, Mode m, unsigned level): below(b) { diff --git a/source/io/zlibcompressed.h b/source/io/zlibcompressed.h index 1dc1569..a36be54 100644 --- a/source/io/zlibcompressed.h +++ b/source/io/zlibcompressed.h @@ -44,7 +44,7 @@ public: /** Creates a zlib de/compression object. The underlying object must be open for reading or writing, not both. The level parameter determines compression quality, ranging from 1 (fastest) to 9 (best compression). */ - ZlibCompressed(Base &b, unsigned level = 9): ZlibCompressed(b, b.get_mode()&M_RDWR, level) { } + ZlibCompressed(Base &, unsigned level = 9); /** Creates a zlib de/compression object. Mode must be either read or write, and compatible with the underlying object. */ -- 2.45.2