[esnacc-dev] [PATCH 04/11] windows: adjust the iomanip inlines

Aaron Conole aconole at bytheb.org
Tue Dec 6 19:47:02 UTC 2016

IOManip code did not correctly export the inline keyword, which created
an issue using the c++ compiler.  Additionally, the DLLAPI defines were
not properly exposed, making the asn-iomanip code improperly scoped.

Fixes 7eee77e7191d ("iomanip: Add an IO Manipulator for C++")
Signed-off-by: Aaron Conole <aconole at bytheb.org>
 cxx-lib/inc/asn-iomanip.h | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/cxx-lib/inc/asn-iomanip.h b/cxx-lib/inc/asn-iomanip.h
index 296b675..4338844 100644
--- a/cxx-lib/inc/asn-iomanip.h
+++ b/cxx-lib/inc/asn-iomanip.h
@@ -1,42 +1,45 @@
 #ifndef __ASN_IOMANIP_H__
 #define __ASN_IOMANIP_H__
+#include "asn-config.h"
+#include <iostream>
-inline int SNACCDLL_API
+inline int
     static int iDelimIdx = std::ios_base::xalloc();
     return iDelimIdx;
-static inline std::ios_base& SNACCDLL_API
+static inline std::ios_base&
 SNACC_setiosencodetype(std::ios_base &s, SNACCEncodeDecodeRules t)
     s.iword(getSNACCEncoderIOSType()) = (int)t;
     return s;
-static inline SNACCEncodeDecodeRules SNACCDLL_API
+static inline SNACCEncodeDecodeRules
 SNACC_getiosencodetype(std::ios_base &s)
     return (SNACCEncodeDecodeRules)s.iword(getSNACCEncoderIOSType());
-static inline
-std::ios_base & SNACCDLL_API EncodeBER(std::ios_base &s)
+static inline std::ios_base &
+EncodeBER(std::ios_base &s)
     return SNACC_setiosencodetype(s, BER);
-static inline
-std::ios_base & SNACCDLL_API EncodeNORMAL(std::ios_base &s)
+static inline std::ios_base &
+EncodeNORMAL(std::ios_base &s)
     return SNACC_setiosencodetype(s, SNACC_ASCII);
-static inline
-std::ios_base & SNACCDLL_API EncodePER(std::ios_base &s)
+static inline std::ios_base &
+EncodePER(std::ios_base &s)
     return SNACC_setiosencodetype(s, PER);
@@ -44,10 +47,10 @@ std::ios_base & SNACCDLL_API EncodePER(std::ios_base &s)
 // Overload of operator<< to stream out an AsnType
-std::ostream& SNACCDLL_API operator<<(std::ostream& os,
+SNACCDLL_API std::ostream& operator<<(std::ostream& os,
                                       const SNACC::AsnType& a);
 // Overload of operator>> to stream into an AsnType
-std::istream& SNACCDLL_API operator>>(std::istream& is, SNACC::AsnType& a);
+SNACCDLL_API std::istream& operator>>(std::istream& is, SNACC::AsnType& a);

More information about the dev mailing list