From 97b4b0c704aef8194ab0f5d814d39452d0b3221f Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Wed, 8 Dec 2010 14:00:35 +0000 Subject: Fixed Compiling with mingw-w64 (STR #2308). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7978 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl_Menu_Item.H | 2 +- FL/Fl_Widget.H | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'FL') diff --git a/FL/Fl_Menu_Item.H b/FL/Fl_Menu_Item.H index 2a96a521c..7c01379ef 100644 --- a/FL/Fl_Menu_Item.H +++ b/FL/Fl_Menu_Item.H @@ -241,7 +241,7 @@ struct FL_EXPORT Fl_Menu_Item { and casting the long to a void* and may not be portable to some machines. */ - long argument() const {return (long)user_data_;} + long argument() const {return (long)(fl_intptr_t)user_data_;} /** For convenience you can also define the callback as taking a long argument. This is implemented by casting this to a Fl_Callback diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H index dc3cc408d..9bcaf0beb 100644 --- a/FL/Fl_Widget.H +++ b/FL/Fl_Widget.H @@ -33,6 +33,18 @@ #include "Enumerations.H" +/** + \todo typedef's fl_intptr_t and fl_uintptr_t should be documented. +*/ +#ifdef _WIN64 +#include +typedef intptr_t fl_intptr_t; +typedef uintptr_t fl_uintptr_t; +#else +typedef long fl_intptr_t; +typedef unsigned long fl_uintptr_t; +#endif + class Fl_Widget; class Fl_Window; class Fl_Group; @@ -587,7 +599,7 @@ public: /** Gets the current user data (long) argument that is passed to the callback function. */ - long argument() const {return (long)user_data_;} + long argument() const {return (long)(fl_intptr_t)user_data_;} /** Sets the current user data (long) argument that is passed to the callback function. \todo The user data value must be implemented using a \em union to avoid -- cgit v1.2.3