Index: cpp/frams/util/callbacks.h
===================================================================
--- cpp/frams/util/callbacks.h	(revision 197)
+++ cpp/frams/util/callbacks.h	(revision 247)
@@ -8,4 +8,5 @@
 #include "list.h"
 #include "statrick.h"
+#include <stdint.h>
 
 //#define USEMEMBERCALLBACK
@@ -15,5 +16,5 @@
 public:
 virtual ~CallbackNode() {}
-virtual void action(long calldata)=0;
+virtual void action(intptr_t calldata)=0;
 virtual int equals(CallbackNode*n) {return (this==n);}
 };
@@ -25,11 +26,11 @@
 void *userdata;
 CallBase *object;
-void (CallBase::*member)(void*,long);
+void (CallBase::*member)(void*,intptr_t);
   public:
-MemberCallbackNode(CallBase *o,void (CallBase::*m)(void*,long),void *d):object(o),member(m),userdata(d) {}
-void action(long calldata) {(object->*member)(userdata,calldata);}
+MemberCallbackNode(CallBase *o,void (CallBase::*m)(void*,intptr_t),void *d):object(o),member(m),userdata(d) {}
+void action(intptr_t calldata) {(object->*member)(userdata,calldata);}
 int equals(CallbackNode*);
 };
-#define MEMBERCALLBACK(obj,mem,dat) new MemberCallbackNode((CallBase*)(obj),(void (CallBase::*)(void*,long))(mem),(void*)(dat))
+#define MEMBERCALLBACK(obj,mem,dat) new MemberCallbackNode((CallBase*)(obj),(void (CallBase::*)(void*,intptr_t))(mem),(void*)(dat))
 #endif
 
@@ -37,11 +38,11 @@
 {
 void *userdata;
-void (*fun)(void*,long);
+void (*fun)(void*,intptr_t);
   public:
-FunctionCallbackNode(void (*f)(void*,long),void *d):userdata(d),fun(f) {}
-void action(long calldata) {(*fun)(userdata,calldata);}
+FunctionCallbackNode(void (*f)(void*,intptr_t),void *d):userdata(d),fun(f) {}
+void action(intptr_t calldata) {(*fun)(userdata,calldata);}
 int equals(CallbackNode*);
 };
-#define FUNCTIONCALLBACK(fun,dat) new FunctionCallbackNode((void (*)(void*,long))(fun),(void*)(dat))
+#define FUNCTIONCALLBACK(fun,dat) new FunctionCallbackNode((void (*)(void*,intptr_t))(fun),(void*)(dat))
 
 class StatrickCallbackNode :public CallbackNode
@@ -49,11 +50,11 @@
 void *object;
 void *userdata;
-void (*fun)(void*,void*,long);
+void (*fun)(void*,void*,intptr_t);
   public:
-StatrickCallbackNode(void *o,void (*f)(void*,void*,long),void *d):object(o),userdata(d),fun(f) {}
-void action(long calldata) {(*fun)(object,userdata,calldata);}
+StatrickCallbackNode(void *o,void (*f)(void*,void*,intptr_t),void *d):object(o),userdata(d),fun(f) {}
+void action(intptr_t calldata) {(*fun)(object,userdata,calldata);}
 int equals(CallbackNode*);
 };
-#define STATRICKCALLBACK(obj,name,dat) new StatrickCallbackNode((void*)(obj),(void (*)(void*,void*,long))STATRICKNAME(name),(void*)(dat))
+#define STATRICKCALLBACK(obj,name,dat) new StatrickCallbackNode((void*)(obj),(void (*)(void*,void*,intptr_t))STATRICKNAME(name),(void*)(dat))
 
 /**
@@ -61,6 +62,6 @@
       add(Function* fun, void* anydata)
    'fun' will be called with your pointer as the first argument (void*)
-   and event specific value as the second argument (long)
-      fun(void* anydata,long eventdata)
+   and event specific value as the second argument (intptr_t)
+      fun(void* anydata,intptr_t eventdata)
 
    'StatrickCallbackNode' uses static functions to emulate object member calls.
@@ -81,13 +82,13 @@
 ~Callback();
 CallbackNode* add(CallbackNode*n);
-CallbackNode* add(void (*f)(void*,long),void *d)
+CallbackNode* add(void (*f)(void*,intptr_t),void *d)
 	{return add(new FunctionCallbackNode(f,d));}
-void remove(void (*f)(void*,long),void *d)
+void remove(void (*f)(void*,intptr_t),void *d)
 	{remove(new FunctionCallbackNode(f,d));}
 void remove(CallbackNode*n);
 void removeNode(CallbackNode*n);
-void operator+=(void* fun) {add((void (*)(void*,long))fun,0);}
-void operator-=(void* fun) {remove((void (*)(void*,long))fun,0);}
-void action(long data);
+void operator+=(void* fun) {add((void (*)(void*,intptr_t))fun,0);}
+void operator-=(void* fun) {remove((void (*)(void*,intptr_t))fun,0);}
+void action(intptr_t data);
 void action() {action(0);}
 int size() {return SList::size();}
@@ -97,11 +98,11 @@
 ///////////////////
 
-#define STCALLBACKDEF(name) STATRICKDEF2(name,void*,long)
-#define STCALLBACKDEFC(cls,name) STATRICKSTUB2(cls,name,void*,long)  \
-	void name(void* arg1,long arg2)
-#define VIRTCALLBACKDEF(name) STATRICKSTUB2(STATRICKCLASS,name,void*,long)  \
-	virtual void name(void* arg1,long arg2)
-#define VIRTCALLBACKDEFC(cls,name) STATRICKSTUB2(cls,name,void*,long)  \
-	virtual void name(void* arg1,long arg2)
+#define STCALLBACKDEF(name) STATRICKDEF2(name,void*,intptr_t)
+#define STCALLBACKDEFC(cls,name) STATRICKSTUB2(cls,name,void*,intptr_t)  \
+	void name(void* arg1,intptr_t arg2)
+#define VIRTCALLBACKDEF(name) STATRICKSTUB2(STATRICKCLASS,name,void*,intptr_t)  \
+	virtual void name(void* arg1,intptr_t arg2)
+#define VIRTCALLBACKDEFC(cls,name) STATRICKSTUB2(cls,name,void*,intptr_t)  \
+	virtual void name(void* arg1,intptr_t arg2)
 
 /* STCALLBACKDEFC(Class,name)
@@ -115,5 +116,5 @@
  */
 
-#define CALLBACKARGS void* arg1,long arg2
+#define CALLBACKARGS void* arg1,intptr_t arg2
 
 #endif
