+// helpers used by wxCharTypeBuffer
+namespace wxPrivate
+{
+
+struct UntypedBufferData
+{
+ enum Kind
+ {
+ Owned,
+ NonOwned
+ };
+
+ UntypedBufferData(void *str, Kind kind = Owned)
+ : m_str(str), m_ref(1), m_owned(kind == Owned) {}
+
+ ~UntypedBufferData()
+ {
+ if ( m_owned )
+ free(m_str);
+ }
+
+ void *m_str;
+
+ // "short" to have sizeof(Data)=8 on 32bit archs
+ unsigned short m_ref;
+
+ bool m_owned;
+};
+
+// this has to be defined inside the DLL (and not e.g. as a static variable
+// inside an inline function) as otherwise MSVC gives link errors when the
+// functions are effectively inlined (i.e. in non-debug build)
+//
+// NB: this is defined in string.cpp and not the (non-existent) buffer.cpp
+extern WXDLLIMPEXP_DATA_BASE(UntypedBufferData * const) untypedNullDataPtr;
+
+} // namespace wxPrivate
+