FLTK 1.4.0
platform_types.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016-2022 by Bill Spitzak and others.
3  *
4  * This library is free software. Distribution and use rights are outlined in
5  * the file "COPYING" which should have been included with this file. If this
6  * file is missing or damaged, see the license at:
7  *
8  * https://www.fltk.org/COPYING.php
9  *
10  * Please see the following page on how to report bugs and issues:
11  *
12  * https://www.fltk.org/bugs.php
13  */
14 
22 #ifdef FL_DOXYGEN
23 
28 typedef opaque fl_intptr_t;
33 typedef opaque fl_uintptr_t;
34 
43 typedef opaque Fl_Offscreen;
44 
53 typedef struct opaque *Fl_Region;
54 typedef opaque FL_SOCKET;
63 typedef struct opaque *GLContext;
64 
65 # define FL_COMMAND opaque
66 # define FL_CONTROL opaque
68 #else /* FL_DOXYGEN */
69 
70 #ifndef FL_PLATFORM_TYPES_H
71 #define FL_PLATFORM_TYPES_H
72 
73 #include <FL/fl_config.h>
74 
75 /* Platform-dependent types are defined here.
76  These types must be defined by any platform:
77  FL_SOCKET, struct dirent, fl_intptr_t, fl_uintptr_t
78 
79  NOTE: *FIXME* AlbrechtS 13 Apr 2016 (concerning FL_SOCKET)
80  ----------------------------------------------------------
81  The Fl::add_fd() API is partially inconsistent because some of the methods
82  explicitly use 'int', but the callback typedefs use FL_SOCKET. With the
83  definition of FL_SOCKET below we can have different data sizes and
84  different signedness of socket numbers on *some* platforms.
85  */
86 
87 #ifdef _WIN64
88 
89 #if defined(_MSC_VER)
90 # include <stddef.h> /* M$VC */
91 #else
92 # include <stdint.h>
93 #endif
94 
95 typedef intptr_t fl_intptr_t;
96 typedef uintptr_t fl_uintptr_t;
97 
98 #else /* ! _WIN64 */
99 
100 typedef long fl_intptr_t;
101 typedef unsigned long fl_uintptr_t;
102 
103 #endif /* _WIN64 */
104 
105 typedef void *GLContext;
106 typedef void *Fl_Region;
107 typedef fl_uintptr_t Fl_Offscreen;
108 
109 /* Allows all hybrid combinations except WIN32 + X11 with MSVC */
110 #if defined(_WIN32) && !defined(__MINGW32__)
111  struct dirent {char d_name[1];};
112 #else
113 # include <dirent.h>
114 #endif
115 
116 # if defined(_WIN64) && defined(_MSC_VER)
117 typedef unsigned __int64 FL_SOCKET; /* *FIXME* - FL_SOCKET (see above) */
118 # else
119 typedef int FL_SOCKET;
120 # endif
121 
122 #include <FL/Fl_Export.H>
123 extern FL_EXPORT int fl_command_modifier();
124 extern FL_EXPORT int fl_control_modifier();
125 # define FL_COMMAND fl_command_modifier()
126 # define FL_CONTROL fl_control_modifier()
127 
128 #endif /* FL_PLATFORM_TYPES_H */
129 
130 #endif /* FL_DOXYGEN */
opaque Fl_Offscreen
Platform-specific value representing an offscreen drawing buffer.
Definition: platform_types.h:43
struct opaque * GLContext
Pointer to a platform-specific structure representing the window's OpenGL rendering context.
Definition: platform_types.h:63
opaque fl_uintptr_t
An unsigned integral type large enough to store a pointer or an unsigned long value.
Definition: platform_types.h:33
struct opaque * Fl_Region
Pointer to a platform-specific structure representing a collection of rectangles.
Definition: platform_types.h:53
opaque FL_SOCKET
socket or file descriptor
Definition: platform_types.h:54
opaque fl_intptr_t
An integral type large enough to store a pointer or a long value.
Definition: platform_types.h:28