wx/ipcbase.h
wx/isql.h
wx/isqlext.h
+ wx/link.h
wx/list.h
wx/listimpl.cpp
wx/log.h
#ifndef _WX_FORCELNK_H_
#define _WX_FORCELNK_H_
-
-
-// This must be part of the module you want to force:
-#define FORCE_LINK_ME(module_name) \
- int _wx_link_dummy_func_##module_name (); \
- int _wx_link_dummy_func_##module_name () \
- { \
- return 1; \
- }
-
-
-// And this must be somewhere where it certainly will be linked:
-#define FORCE_LINK(module_name) \
- extern int _wx_link_dummy_func_##module_name (); \
- static int _wx_link_dummy_var_##module_name = \
- _wx_link_dummy_func_##module_name ();
+// compatibility defines
+#define FORCE_LINK wxFORCE_LINK_MODULE
+#define FORCE_LINK_ME wxFORCE_LINK_THIS_MODULE
#define FORCE_WXHTML_MODULES() \
FORCE_LINK(m_layout) \
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: wx/link.h
+// Purpose: macros to force linking modules which might otherwise be
+// discarded by the linker
+// Author: Vaclav Slavik
+// RCS-ID: $Id$
+// Copyright: (c) Vaclav Slavik
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_LINK_H_
+#define _WX_LINK_H_
+
+// This must be part of the module you want to force:
+#define wxFORCE_LINK_THIS_MODULE(module_name) \
+ extern void _wx_link_dummy_func_##module_name (); \
+ void _wx_link_dummy_func_##module_name () { }
+
+
+// And this must be somewhere where it certainly will be linked:
+#define wxFORCE_LINK_MODULE(module_name) \
+ extern int _wx_link_dummy_func_##module_name (); \
+ static struct wxForceLink##module_name \
+ { \
+ wxForceLink##module_name() \
+ { \
+ _wx_link_dummy_func_##module_name (); \
+ } \
+ } _wx_link_dummy_var_##module_name;
+
+
+#endif // _WX_LINK_H_
#if wxUSE_STREAMS && wxUSE_ARCHIVE_STREAMS
#include "wx/archive.h"
+#include "wx/link.h"
IMPLEMENT_ABSTRACT_CLASS(wxArchiveEntry, wxObject)
IMPLEMENT_ABSTRACT_CLASS(wxArchiveClassFactory, wxObject)
#if wxUSE_ZIPSTREAM
-//FORCE_LINK(zipstrm)
-extern int _wx_link_dummy_func_zipstrm();
-static int _wx_link_dummy_var_zipstrm =
- _wx_link_dummy_func_zipstrm ();
+wxFORCE_LINK_MODULE(zipstrm)
#endif
#include "wx/buffer.h"
#include "wx/ptr_scpd.h"
#include "wx/wfstream.h"
+#include "wx/link.h"
#include "zlib.h"
// value for the 'version needed to extract' field (20 means 2.0)
IMPLEMENT_DYNAMIC_CLASS(wxZipEntry, wxArchiveEntry)
IMPLEMENT_DYNAMIC_CLASS(wxZipClassFactory, wxArchiveClassFactory)
-//FORCE_LINK_ME(zipstrm)
-int _wx_link_dummy_func_zipstrm();
-int _wx_link_dummy_func_zipstrm()
-{
- return 1;
-}
+wxFORCE_LINK_THIS_MODULE(zipstrm)
/////////////////////////////////////////////////////////////////////////////
size_t wxStoredInputStream::OnSysRead(void *buffer, size_t size)
{
- size_t count = wxMin(size, (size_t)(m_len - m_pos));
+ size_t count = wxMin(size, wx_truncate_cast(size_t, m_len - m_pos));
count = m_parent_i_stream->Read(buffer, count).LastRead();
m_pos += count;
// Output stream
#include "wx/listimpl.cpp"
-WX_DEFINE_LIST(wx__ZipEntryList);
+WX_DEFINE_LIST(wx__ZipEntryList)
wxZipOutputStream::wxZipOutputStream(wxOutputStream& stream,
int level /*=-1*/,