Index: FL/Fl_Menu_Item.H
===================================================================
--- FL/Fl_Menu_Item.H	(revision 10657)
+++ FL/Fl_Menu_Item.H	(working copy)
@@ -110,7 +110,14 @@
   const char *text;	    ///< menu item text, returned by label()
   int shortcut_;	    ///< menu item shortcut
   Fl_Callback *callback_;   ///< menu item callback
+#ifdef FL_DOXYGEN
   void *user_data_;	    ///< menu item user_data for the menu's callback
+#else
+  union {
+    void *user_data_;
+    long user_value_;
+  };
+#endif
   int flags;		    ///< menu item flags like FL_MENU_TOGGLE, FL_MENU_RADIO
   uchar labeltype_;	    ///< how the menu item text looks like
   Fl_Font labelfont_;	    ///< which font for this menu item text
@@ -240,7 +247,7 @@
     for the menu item's callback function.
     \see Fl_Callback_p Fl_MenuItem::callback() const
    */
-  void callback(Fl_Callback1*c, long p=0) {callback_=(Fl_Callback*)c; user_data_=(void*)p;}
+  void callback(Fl_Callback1 *c, long p=0) {callback_=(Fl_Callback*)c; user_value_ = p;}
 
   /**
     Gets the user_data() argument that is sent to the callback function.
@@ -256,7 +263,7 @@
     argument.  This method casts the stored userdata() argument to long
     and returns it as a \e long value.
   */
-  long argument() const {return (long)(fl_intptr_t)user_data_;}
+  long argument() const {return user_value_;}
   /**
     Sets the user_data() argument that is sent to the callback function.
     For convenience you can also define the callback as taking a long
@@ -264,7 +271,7 @@
     and stores it in the menu item's userdata() member.
     This may not be portable to some machines.
   */
-  void argument(long v) {user_data_ = (void*)v;}
+  void argument(long v) {user_value_ = v;}
 
   /** Gets what key combination shortcut will trigger the menu item. */
   int shortcut() const {return shortcut_;}
@@ -394,7 +401,14 @@
     the callback.
     You must first check that callback() is non-zero before calling this.
   */
-  void do_callback(Fl_Widget* o,long arg) const {callback_(o, (void*)arg);}
+  void do_callback(Fl_Widget* o,long arg) const {
+    union {
+      void *pointer;
+      long value;
+    } vl;
+    vl.value = arg;
+    callback_(o, vl.pointer);
+  }
 
   // back-compatibility, do not use:
 
Index: FL/Fl_Widget.H
===================================================================
--- FL/Fl_Widget.H	(revision 10657)
+++ FL/Fl_Widget.H	(working copy)
@@ -103,7 +103,10 @@
 
   Fl_Group* parent_;
   Fl_Callback* callback_;
-  void* user_data_;
+  union {
+    void *user_data_;
+    long user_value_;
+  };
   int x_,y_,w_,h_;
   Fl_Label label_;
   unsigned int flags_;
@@ -584,7 +587,7 @@
       \param[in] cb new callback
       \param[in] p user data
    */
-  void callback(Fl_Callback1*cb, long p=0) {callback_=(Fl_Callback*)cb; user_data_=(void*)p;}
+  void callback(Fl_Callback1*cb, long p=0) {callback_=(Fl_Callback*)cb; user_value_ = p;}
 
   /** Gets the user data for this widget.
       Gets the current user data (void *) argument that is passed to the callback function.
@@ -600,13 +603,13 @@
 
   /** Gets the current user data (long) argument that is passed to the callback function.
    */
-  long argument() const {return (long)(fl_intptr_t)user_data_;}
+  long argument() const {return user_value_;}
 
   /** Sets the current user data (long) argument that is passed to the callback function.
       \todo The user data value must be implemented using \em intptr_t or similar
       to avoid 64-bit machine incompatibilities.
    */
-  void argument(long v) {user_data_ = (void*)v;}
+  void argument(long v) {user_value_ = v;}
 
   /** Returns the conditions under which the callback is called.
 
@@ -856,7 +859,14 @@
       \param[in] arg call the callback with \p arg as the user data argument
       \see callback()
    */
-  void do_callback(Fl_Widget* o,long arg) {do_callback(o,(void*)arg);}
+  void do_callback(Fl_Widget* o,long arg) {
+    union {
+      void *pointer;
+      long value;
+    } vl;
+    vl.value = arg;
+    do_callback(o, vl.pointer);
+  }
 
   // Causes a widget to invoke its callback function with arbitrary arguments.
   // Documentation and implementation in Fl_Widget.cxx
