2007-10-22 Mike Kestner <mkestner@novell.com>

* configure.in.in: add a win64 check and a compiler define for
	handling win64 32bit longs.
	* generator/LPGen.cs: use int to marshal on win64.
	* generator/LPUGen.cs: use uint to marshal on win64.
	* generator/SymbolTable.cs: remove fixme.

svn path=/trunk/gtk-sharp/; revision=87922
This commit is contained in:
Mike Kestner 2007-10-22 17:34:02 +00:00
parent ed158bd493
commit 2a7b706c5a
5 changed files with 43 additions and 3 deletions

View file

@ -1,3 +1,11 @@
2007-10-22 Mike Kestner <mkestner@novell.com>
* configure.in.in: add a win64 check and a compiler define for
handling win64 32bit longs.
* generator/LPGen.cs: use int to marshal on win64.
* generator/LPUGen.cs: use uint to marshal on win64.
* generator/SymbolTable.cs: remove fixme.
2007-10-16 Mike Kestner <mkestner@novell.com>
* gtk/CellRenderer.custom : marshal GTypes as IntPtr like the

View file

@ -13,7 +13,16 @@ AC_SUBST(POLICY_VERSIONS)
PACKAGE_VERSION=gtk-sharp-2.0
AC_SUBST(PACKAGE_VERSION)
WIN64DEFINES=
case "$host" in
x86_64-*-mingw*|x86_64-*-cygwin*)
WIN64DEFINES="-define:WIN64LONGS"
platform_win32=yes
AC_DEFINE(PLATFORM_WIN32,1,[Platform is Win32])
CC="gcc -mno-cygwin -g"
HOST_CC="gcc"
;;
*-*-mingw*|*-*-cygwin*)
platform_win32=yes
AC_DEFINE(PLATFORM_WIN32,1,[Platform is Win32])
@ -70,7 +79,7 @@ AC_ARG_ENABLE(debug, [ --enable-debug Build debugger (.mdb) files for
fi
CSDEFINES='@VERSIONCSDEFINES@'
CSFLAGS="$DEBUG_FLAGS $CSDEFINES"
CSFLAGS="$DEBUG_FLAGS $CSDEFINES $WIN64DEFINES"
AC_SUBST(CSFLAGS)
GTK_SHARP_VERSION_CFLAGS='@VERSIONCFLAGS@'

View file

@ -30,18 +30,30 @@ namespace GtkSharp.Generation {
public override string MarshalType {
get {
#if WIN64LONGS
return "int";
#else
return "IntPtr";
#endif
}
}
public override string CallByName (string var_name)
{
#if WIN64LONGS
return "(int) " + var_name;
#else
return "new IntPtr (" + var_name + ")";
#endif
}
public override string FromNative(string var)
{
#if WIN64LONGS
return var;
#else
return "(long) " + var;
#endif
}
public void WriteAccessors (StreamWriter sw, string indent, string var)

View file

@ -30,18 +30,30 @@ namespace GtkSharp.Generation {
public override string MarshalType {
get {
#if WIN64LONGS
return "uint";
#else
return "UIntPtr";
#endif
}
}
public override string CallByName (string var_name)
{
#if WIN64LONGS
return "(uint) " + var_name;
#else
return "new UIntPtr (" + var_name + ")";
#endif
}
public override string FromNative(string var)
{
#if WIN64LONGS
return var;
#else
return "(ulong) " + var;
#endif
}
public void WriteAccessors (StreamWriter sw, string indent, string var)

View file

@ -75,8 +75,7 @@ namespace GtkSharp.Generation {
AddType (new SimpleGen ("double", "double", "0.0"));
AddType (new SimpleGen ("GQuark", "int", "0"));
// platform specific integer types. these will break on any
// platform where sizeof (long) != sizeof (pointer)
// platform specific integer types.
AddType (new LPGen ("ssize_t"));
AddType (new LPGen ("long"));
AddType (new LPGen ("glong"));