diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2016-04-23 15:08:26 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2016-04-23 15:08:26 +0000 |
| commit | 1db8d51eaed5465abcc9c4f3f6d20799c93dd6eb (patch) | |
| tree | 93c1ac758251182cfe5a389da05913d3e22ae34e /FL | |
| parent | c89a609be263f6848b18df7aa86a12fe84b7693a (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')
| -rw-r--r-- | FL/Fl_Widget.H | 18 | ||||
| -rw-r--r-- | FL/platform_types.h | 32 |
2 files changed, 29 insertions, 21 deletions
diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H index fe978f125..ac42d3bf5 100644 --- a/FL/Fl_Widget.H +++ b/FL/Fl_Widget.H @@ -3,7 +3,7 @@ // // Widget header file for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2015 by Bill Spitzak and others. +// Copyright 1998-2016 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -24,22 +24,6 @@ #include "Enumerations.H" -/** - \todo typedef's fl_intptr_t and fl_uintptr_t should be documented. -*/ -#ifdef _WIN64 -#if defined(__GNUC__) || defined(__clang__) -#include <stdint.h> -#else -#include <stddef.h> // M$VC -#endif -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; 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; |
