Use G_BEGIN_DECLS and G_END_DECLS. Define G_MODULE_EXPORT correctly on

2001-02-21  Tor Lillqvist  <tml@iki.fi>

	* gmodule.h: Use G_BEGIN_DECLS and G_END_DECLS. Define
	G_MODULE_EXPORT correctly on Cygwin, too.

	* gmodule-win32.c (_g_module_open): Convert path to Windows format
	on Cygwin.

	* Makefile.am (libglib): Use libglib-1.3.la from
	top_builddir. Invoke libtool with -no-undefined for Win32 and
	Cygwin.
This commit is contained in:
Tor Lillqvist 2001-03-09 21:33:23 +00:00 committed by Tor Lillqvist
parent 754d8ddad8
commit 8dd8609870
4 changed files with 42 additions and 18 deletions

View File

@ -5,6 +5,18 @@
* gmodule.def, gmodule.h, gmodule.c: Removed g_log_domain_gmodule.
2001-02-21 Tor Lillqvist <tml@iki.fi>
* gmodule.h: Use G_BEGIN_DECLS and G_END_DECLS. Define
G_MODULE_EXPORT correctly on Cygwin, too.
* gmodule-win32.c (_g_module_open): Convert path to Windows format
on Cygwin.
* Makefile.am (libglib): Use libglib-1.3.la from
top_builddir. Invoke libtool with -no-undefined for Win32 and
Cygwin.
2001-02-17 Havoc Pennington <hp@pobox.com>
Applied patch from Soeren Sandmann:

View File

@ -28,29 +28,36 @@ glibincludedir=$(includedir)/glib-2.0
glibinclude_HEADERS = \
gmodule.h
libglib = $(top_builddir)/libglib-1.3.la # -lglib
libglib = $(top_builddir)/libglib-1.3.la
top_builddir_full=`cd \$(top_builddir); pwd`
lib_LTLIBRARIES = libgmodule-1.3.la libgplugin_a.la libgplugin_b.la
if PLATFORM_WIN32
no_undefined = -no-undefined
endif
if OS_WIN32
export_symbols = -export-symbols gmodule.def
endif
libgmodule_1_3_la_SOURCES = gmodule.c
libgmodule_1_3_la_LDFLAGS = \
@G_MODULE_LDFLAGS@ \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-export-dynamic
-export-dynamic $(no_undefined) $(export_symbols)
libgmodule_1_3_la_LIBADD = @G_MODULE_LIBS_EXTRA@ @G_MODULE_LIBS@ # $(libglib)
libgmodule_1_3_la_LIBADD = @G_MODULE_LIBS_EXTRA@ @G_MODULE_LIBS@ $(libglib)
# we should really depend on $(libglib) for libgmodule.la, but libtool has a
# problem with this ;(
# problem with this ;( Ummm? Does it?
libgplugin_a_la_SOURCES = libgplugin_a.c
libgplugin_a_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module
libgplugin_a_la_LIBADD = @G_MODULE_LIBS@ @G_MODULE_LIBS_EXTRA@ @G_MODULE_PLUGIN_LIBS@ # $(libglib)
libgplugin_a_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module $(no_undefined)
libgplugin_a_la_LIBADD = @G_MODULE_LIBS@ @G_MODULE_LIBS_EXTRA@ @G_MODULE_PLUGIN_LIBS@ libgmodule-1.3.la $(libglib)
libgplugin_b_la_SOURCES = libgplugin_b.c
libgplugin_b_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module
libgplugin_b_la_LIBADD = @G_MODULE_LIBS@ @G_MODULE_LIBS_EXTRA@ @G_MODULE_PLUGIN_LIBS@ # $(libglib)
libgplugin_b_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module $(no_undefined)
libgplugin_b_la_LIBADD = @G_MODULE_LIBS@ @G_MODULE_LIBS_EXTRA@ @G_MODULE_PLUGIN_LIBS@ libgmodule-1.3.la $(libglib)
noinst_PROGRAMS = testgmodule
testgmodule_LDFLAGS += @G_MODULE_LDFLAGS@

View File

@ -38,6 +38,10 @@
#include <tlhelp32.h>
#else
#ifdef G_WITH_CYGWIN
#include <sys/cygwin.h>
#endif
/* The w32api headers supplied with the mingw gcc don't have
* tlhelp32.h. We really only need the MODULEENTRY32 struct and the
* TH32CS_SNAPMODULE value, so provide them here.
@ -77,6 +81,12 @@ _g_module_open (const gchar *file_name,
gboolean bind_lazy)
{
HINSTANCE handle;
#ifdef G_WITH_CYGWIN
gchar tmp[MAX_PATH];
cygwin_conv_to_win32_path(file_name, tmp);
file_name = tmp;
#endif
handle = LoadLibrary (file_name);
if (!handle)

View File

@ -29,19 +29,17 @@
#include <glib.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
G_BEGIN_DECLS
/* exporting and importing functions, this is special cased
* to feature Windows dll stubs.
*/
#define G_MODULE_IMPORT extern
#if defined (G_OS_WIN32)
#ifdef G_PLATFORM_WIN32
# define G_MODULE_EXPORT __declspec(dllexport)
#else /* !G_OS_WIN32 */
#else /* !G_PLATFORM_WIN32 */
# define G_MODULE_EXPORT
#endif /* !G_OS_WIN32 */
#endif /* !G_PLATFORM_WIN32 */
typedef enum
{
@ -92,9 +90,6 @@ gchar* g_module_build_path (const gchar *directory,
const gchar *module_name);
#ifdef __cplusplus
}
#endif /* __cplusplus */
G_END_DECLS
#endif /* __GMODULE_H__ */