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
This commit is contained in:
Albrecht Schlosser 2016-04-23 15:08:26 +00:00
parent c89a609be2
commit 1db8d51eae
2 changed files with 29 additions and 21 deletions

View File

@ -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;

View File

@ -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;