pkgsrc/devel/tvision/patches/patch-lib_tobjstrm_h

37 lines
983 B
Text

$NetBSD: patch-lib_tobjstrm_h,v 1.2 2016/05/18 20:19:46 joerg Exp $
- Use intptr_t to deal with pointer-sized values.
--- lib/tobjstrm.h.orig 2016-05-18 10:49:59.000000000 +0000
+++ lib/tobjstrm.h
@@ -14,6 +14,7 @@
#include <iostream>
#include <fstream>
+#include <inttypes.h>
#include <limits.h>
/**
@@ -139,7 +140,7 @@ const P_id_type P_id_notFound = UINT_MAX
*/
typedef TStreamable *(*BUILDER)();
-#define __DELTA( d ) ((int)(TStreamable*)(d*)1-1 )
+#define __DELTA( d ) ((intptr_t)(TStreamable*)(d*)1-1 )
/**
* TStreamableClass is used by @ref TStreamableTypes and @ref pstream in the
@@ -179,11 +180,11 @@ public:
* typedef TStreamable *(*BUILDER)();
* </pre>
*/
- TStreamableClass(const char *aName, BUILDER aBuild, int aDelta );
+ TStreamableClass(const char *aName, BUILDER aBuild, intptr_t aDelta );
private:
const char *name;
BUILDER build;
- int delta;
+ intptr_t delta;
};
#endif // Uses_TStreamableClass