summaryrefslogtreecommitdiff
path: root/FL/platform_types.h
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2016-04-23 15:08:26 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2016-04-23 15:08:26 +0000
commit1db8d51eaed5465abcc9c4f3f6d20799c93dd6eb (patch)
tree93c1ac758251182cfe5a389da05913d3e22ae34e /FL/platform_types.h
parentc89a609be263f6848b18df7aa86a12fe84b7693a (diff)
Move typedef fl_(u)intptr_t to FL/platform_types.h.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11686 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/platform_types.h')
-rw-r--r--FL/platform_types.h32
1 files changed, 28 insertions, 4 deletions
diff --git a/FL/platform_types.h b/FL/platform_types.h
index 05b5737b8..17f0ad9ea 100644
--- a/FL/platform_types.h
+++ b/FL/platform_types.h
@@ -19,16 +19,39 @@
/* Platform-dependent types are defined here.
These types must be defined by any platform:
- Fl_Offscreen, Fl_Bitmask, Fl_Region, FL_SOCKET, struct dirent, struct stat
+ Fl_Offscreen, Fl_Bitmask, Fl_Region, FL_SOCKET, struct dirent, struct stat,
+ fl_intptr_t, fl_uintptr_t
NOTE: *FIXME* AlbrechtS 13 Apr 2016 (concerning FL_SOCKET)
----------------------------------------------------------
- The socket API is partially inconsistent because some of the methods
- use int explicitly, but the callback typedefs use FL_SOCKET. With the
+ The Fl::add_fd() API is partially inconsistent because some of the methods
+ explicitly use 'int', but the callback typedefs use FL_SOCKET. With the
definition of FL_SOCKET below we can have different data sizes and
different signedness of socket numbers on *some* platforms.
*/
+/**
+ \todo typedef's fl_intptr_t and fl_uintptr_t should be documented.
+*/
+#ifdef _WIN64
+
+#if defined(_MSC_VER)
+# include <stddef.h> /* M$VC */
+#else
+# include <stdint.h>
+#endif
+
+typedef intptr_t fl_intptr_t;
+typedef uintptr_t fl_uintptr_t;
+
+#else /* ! _WIN64 */
+
+typedef long fl_intptr_t;
+typedef unsigned long fl_uintptr_t;
+
+#endif /* _WIN64 */
+
+
#ifdef __APPLE__
typedef struct CGContext* Fl_Offscreen;
typedef struct CGImage* Fl_Bitmask;
@@ -69,7 +92,8 @@ struct stat { /* the FLTK source code uses part of the stat() API */
#define S_IFDIR 0040000 /* directory */
#define S_IFREG 0100000 /* regular */
-#else
+#else /* X11 */
+
typedef unsigned long Fl_Offscreen;
typedef unsigned long Fl_Bitmask;
typedef struct _XRegion *Fl_Region;