Skip to content

Commit 7046a43

Browse files
authored
build: avoid ODR violation from different struct layout per TU (#326)
1 parent 5bbb3a1 commit 7046a43

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

src/vmime/security/sasl/SASLContext.hpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
3232

33+
#include <gsasl.h>
3334

3435
#include "vmime/types.hpp"
3536

@@ -116,13 +117,7 @@ class VMIME_EXPORT SASLContext : public object, public enable_shared_from_this <
116117

117118
static const string getErrorMessage(const string& fname, const int code);
118119

119-
120-
#ifdef GSASL_VERSION
121120
Gsasl* m_gsaslContext;
122-
#else
123-
void* m_gsaslContext;
124-
#endif // GSASL_VERSION
125-
126121
};
127122

128123

src/vmime/security/sasl/SASLSession.hpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#if VMIME_HAVE_MESSAGING_FEATURES && VMIME_HAVE_SASL_SUPPORT
3232

33+
#include <gsasl.h>
3334

3435
#include "vmime/types.hpp"
3536

@@ -155,18 +156,10 @@ class VMIME_EXPORT SASLSession : public object, public enable_shared_from_this <
155156
shared_ptr <authenticator> m_auth;
156157
shared_ptr <SASLMechanism> m_mech;
157158

158-
#ifdef GSASL_VERSION
159159
Gsasl* m_gsaslContext;
160160
Gsasl_session* m_gsaslSession;
161161

162162
static int gsaslCallback(Gsasl* ctx, Gsasl_session* sctx, Gsasl_property prop);
163-
#else
164-
void* m_gsaslContext;
165-
void* m_gsaslSession;
166-
167-
static int gsaslCallback(void* ctx, void* sctx, int prop);
168-
#endif // GSASL_VERSION
169-
170163
};
171164

172165

0 commit comments

Comments
 (0)