AJA NTV2 SDK  17.6.0.2675
NTV2 SDK 17.6.0.2675
ajatypes.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #ifndef AJATYPES_H
9 #define AJATYPES_H
10 
11 #if defined (AJAMac)
12  #define NTV2_USE_STDINT
13 #endif // if not MSWindows
14 
42 
43 #define NTV2_DEPRECATE // Do not undefine -- all symbols/APIs first deprecated in SDK 12.4 or earlier have been removed
44 #define NTV2_DEPRECATE_12_5 // Do not undefine -- all symbols/APIs first deprecated in SDK 12.5 have been removed
45 #define NTV2_DEPRECATE_12_6 // Do not undefine -- all symbols/APIs first deprecated in SDK 12.6 have been removed
46 #define NTV2_DEPRECATE_12_7 // Do not undefine -- all symbols/APIs first deprecated in SDK 12.7 have been removed
47 #define NTV2_DEPRECATE_13_0 // Do not undefine -- all symbols/APIs first deprecated in SDK 13.0 have been removed
48 #define NTV2_DEPRECATE_13_1 // Do not undefine -- all symbols/APIs first deprecated in SDK 13.1 have been removed
49 #define NTV2_DEPRECATE_14_0 // Do not undefine -- all symbols/APIs first deprecated in SDK 14.0 have been removed
50 #define NTV2_DEPRECATE_14_1 // Do not undefine -- all symbols/APIs first deprecated in SDK 14.1 (never released) have been removed
51 #define NTV2_DEPRECATE_14_2 // Do not undefine -- all symbols/APIs first deprecated in SDK 14.2 have been removed
52 #define NTV2_DEPRECATE_14_3 // Do not undefine -- all symbols/APIs first deprecated in SDK 14.3 have been removed
53 #define NTV2_DEPRECATE_15_0 // Do not undefine -- all symbols/APIs first deprecated in SDK 15.0 have been removed
54 #define NTV2_DEPRECATE_15_1 // Do not undefine -- all symbols/APIs first deprecated in SDK 15.1 have been removed
55 #define NTV2_DEPRECATE_15_2 // Do not undefine -- all symbols/APIs first deprecated in SDK 15.2 have been removed
56 #define NTV2_DEPRECATE_15_3 // Do not undefine -- all symbols/APIs first deprecated in SDK 15.3 (never released) have been removed
57 #define NTV2_DEPRECATE_15_5 // Do not undefine -- all symbols/APIs first deprecated in SDK 15.5 have been removed
58 #define NTV2_DEPRECATE_15_6 // Do not undefine -- all symbols/APIs first deprecated in SDK 15.6 (never released) have been removed
59 //#define NTV2_DEPRECATE_16_0 // If defined, excludes all symbols/APIs first deprecated in SDK 16.0
60 //#define NTV2_DEPRECATE_16_1 // If defined, excludes all symbols/APIs first deprecated in SDK 16.1
61 //#define NTV2_DEPRECATE_16_2 // If defined, excludes all symbols/APIs first deprecated in SDK 16.2
62 //#define NTV2_DEPRECATE_16_3 // If defined, excludes all symbols/APIs first deprecated in SDK 16.3 (never released)
63 //#define NTV2_DEPRECATE_17_0 // If defined, excludes all symbols/APIs first deprecated in SDK 17.0
64 //#define NTV2_DEPRECATE_17_1 // If defined, excludes all symbols/APIs first deprecated in SDK 17.1
65 //#define NTV2_DEPRECATE_17_2 // If defined, excludes all symbols/APIs first deprecated in SDK 17.2 (never released)
66 //#define NTV2_DEPRECATE_17_5 // If defined, excludes all symbols/APIs first deprecated in SDK 17.5
67 //#define NTV2_DEPRECATE_17_6 // If defined, excludes all symbols/APIs first deprecated in SDK 17.6
68 
69 
74 
75 /**************************************************************************************************************
76  NTV2_NULL_DEVICE When undefined (the default), the platform-specific implementations of
77  OpenLocalPhysical are included in the build, making it possible to connect to
78  locally-attached physical devices via the NTV2 kernel driver.
79 
80  When defined, all platform-specific implementations of OpenLocalPhysical are
81  omitted from the build, making it impossible to connect to locally-attached
82  physical devices via the NTV2 kernel driver. (Only remote or software/virtual
83  devices will be able to be opened via OpenRemote.)
84 
85  Introduced in SDK 12.4.
86 **************************************************************************************************************/
87 //#define NTV2_NULL_DEVICE
88 
89 
90 /**************************************************************************************************************
91  NTV2_NUB_CLIENT_SUPPORT Deprecated in SDK 17.1
92 
93  When defined (the default), the SDK will load and connect to AJA-authorized
94  plugins to support remote or software/virtual NTV2 devices.
95 
96  When undefined, the SDK cannot talk to remote or software/virtual devices.
97 
98  NOTE: In a future SDK, this macro will be eliminated, and it won't be possible
99  to build the SDK without the capability of connecting to AJA-authorized remote
100  or software/virtual NTV2 devices.
101 
102  SDK 16.x - 17.0: Defined by default. This allowed the SDK to connect to
103  unauthenticated remote or software/virtual NTV2 devices.
104 
105  SDK 12.4 - 15.5, this macro was defined by default, allowing the SDK to connect
106  (only) to remote devices via the TCP/IP "nub". (The SDK had no software/virtual
107  device capability before SDK 16.0.)
108 
109  Introduced in SDK 12.4.
110 **************************************************************************************************************/
111 #define NTV2_NUB_CLIENT_SUPPORT
112 
113 
114 /**************************************************************************************************************
115  NTV2_WRITEREG_PROFILING When defined (the default), calls to WriteRegister can be profiled, and
116  CNTV2Card's WriteRegister profiling API is available.
117 
118  When undefined, WriteRegister calls cannot be profiled, and CNTV2Card's
119  WriteRegister profiling API is unavailable.
120 
121  Introduced in SDK 15.1.
122 **************************************************************************************************************/
123 #define NTV2_WRITEREG_PROFILING
124 
125 
126 /**************************************************************************************************************
127  NTV2_USE_CPLUSPLUS11 When defined (the default), the 'ajantv2' portion of the SDK will use C++
128  language and/or STL features that require a C++11 compiler.
129 
130  When undefined, the 'ajantv2' portion of the SDK will not use C++11 features.
131 
132  NOTE: This macro will be deprecated in a future SDK, when it will no longer
133  be possible to build the SDK without a C++11-capable compiler.
134 
135  See also: AJA_USE_CPLUSPLUS11 in 'ajabase/include/types.h'
136 
137  Introduced in SDK 16.0.
138 **************************************************************************************************************/
139 #if !defined(NTV2_USE_CPLUSPLUS11)
140  #define NTV2_USE_CPLUSPLUS11
141 #endif // !defined(NTV2_USE_CPLUSPLUS11)
142 
143 
144 /**************************************************************************************************************
145  NTV2_ALLOW_OPEN_UNSUPPORTED When undefined (the default), unsupported physical devices (see the
146  NTV2GetSupportedDevices utility function) that are attached to the local
147  host cannot be opened (via OpenLocalPhysical).
148 
149  When defined, unsupported physical devices that are attached to the local
150  host will be opened (via OpenLocalPhysical).
151 
152  See also: AJA_USE_CPLUSPLUS11 in 'ajabase/include/types.h'
153 
154  Introduced in SDK 17.0.
155 **************************************************************************************************************/
156 //#define NTV2_ALLOW_OPEN_UNSUPPORTED
157 
158 
159 
163 #define AJA_VIRTUAL virtual // Force use of virtual functions in CNTV2Card, etc.
164 #define AJA_STATIC static // Do not change this.
165 #define NTV2_UNUSED(__p__) (void)__p__
166 
167 #if defined(__CPLUSPLUS__) || defined(__cplusplus)
168  #if defined(AJAMac)
169  #if defined(__clang__)
170  #ifndef __has_feature
171  #define __has_feature(__x__) 0
172  #endif
173  #if __has_feature(cxx_nullptr)
174  #define AJA_CXX11_NULLPTR_AVAILABLE
175  #endif
176  #endif
177  #elif defined(AJALinux)
178  #if defined(__clang__)
179  #ifndef __has_feature
180  #define __has_feature(__x__) 0
181  #endif
182  #if __has_feature(cxx_nullptr)
183  #define AJA_CXX11_NULLPTR_AVAILABLE
184  #endif
185  #elif defined(__GNUC__)
186  #if __cplusplus >= 201103L // C++11 or later
187  #define AJA_CXX11_NULLPTR_AVAILABLE
188  #endif
189  #endif
190  #elif defined(MSWindows)
191  #if defined(_MSC_VER) && _MSC_VER >= 1700 // VS2012 or later:
192  #define AJA_CXX11_NULLPTR_AVAILABLE
193  #endif
194  #endif
195 #endif
196 
197 #if defined(AJA_CXX11_NULLPTR_AVAILABLE)
198  #define AJA_NULL nullptr
199 #else
200  #define AJA_NULL NULL
201 #endif
202 
203 #if defined(__clang__)
204  #ifndef __has_cpp_attribute
205  #define __has_cpp_attribute(__x__) 0
206  #endif
207 
208  #if __has_cpp_attribute(clang::fallthrough)
209  #define AJA_FALL_THRU [[clang::fallthrough]]
210  #else
211  #define AJA_FALL_THRU
212  #endif
213 #elif defined(__GNUC__)
214  #if __GNUC__ >= 5
215  #define AJA_FALL_THRU [[gnu::fallthrough]]
216  #else
217  #define AJA_FALL_THRU
218  #endif
219 #else
220  #define AJA_FALL_THRU
221 #endif
222 
223 
224 #if defined (NTV2_USE_STDINT)
225  #if defined (MSWindows)
226  #define _WINSOCK_DEPRECATED_NO_WARNINGS 1
227  #if (_MSC_VER < 1300)
228  typedef signed char int8_t;
229  typedef signed short int16_t;
230  typedef signed int int32_t;
231  typedef unsigned char uint8_t;
232  typedef unsigned short uint16_t;
233  typedef unsigned int uint32_t;
234  #else
235  #if defined (NTV2_BUILDING_DRIVER)
236  typedef signed __int8 int8_t;
237  typedef signed __int16 int16_t;
238  typedef signed __int32 int32_t;
239  typedef unsigned __int8 uint8_t;
240  typedef unsigned __int16 uint16_t;
241  typedef unsigned __int32 uint32_t;
242  #else
243  #include <stdint.h>
244  #endif
245  #endif
246  typedef signed __int64 int64_t;
247  typedef unsigned __int64 uint64_t;
248  #else
249  #include <stdint.h>
250  #endif
251  typedef uint8_t UByte;
252  typedef int8_t SByte;
253  typedef int16_t Word;
254  typedef uint16_t UWord;
255  typedef int32_t LWord;
256  typedef uint32_t ULWord;
257  typedef uint32_t * PULWord;
258  typedef int64_t LWord64;
259  typedef uint64_t ULWord64;
260  typedef uint64_t Pointer64;
261 #else
262  typedef int LWord;
263  typedef unsigned int ULWord;
264  typedef unsigned int * PULWord;
265  typedef short Word;
266  typedef unsigned short UWord;
267  typedef unsigned char UByte;
268  typedef char SByte;
269 #endif
270 
271 // Platform dependent
273 #if defined (MSWindows)
274  #define _WINSOCK_DEPRECATED_NO_WARNINGS 1
276 
277  #if !defined (NTV2_BUILDING_DRIVER)
278  #ifndef WIN32_LEAN_AND_MEAN
279  #define WIN32_LEAN_AND_MEAN
280  #endif
281 
282  #include <Windows.h>
283 
284  #if defined(DeviceCapabilities)
285  #undef DeviceCapabilities
286  #endif
287  #endif
288  #include <Basetsd.h>
289  typedef unsigned char Boolean;
290  typedef __int64 LWord64;
291  typedef unsigned __int64 ULWord64;
292  typedef unsigned __int64 Pointer64;
293  typedef LWord Fixed_;
294  typedef bool BOOL_;
295  typedef UWord UWord_;
296 
297  typedef signed __int8 int8_t;
298  typedef signed __int16 int16_t;
299  typedef signed __int32 int32_t;
300  typedef signed __int64 int64_t;
301  typedef unsigned __int8 uint8_t;
302  typedef unsigned __int16 uint16_t;
303  typedef unsigned __int32 uint32_t;
304  typedef unsigned __int64 uint64_t;
305 
306  typedef UINT_PTR AJASocket;
307 
308  #define AJATargetBigEndian 0
309  #define AJAFUNC __FUNCTION__
310  #define NTV2_CPP_MIN(__x__,__y__) min((__x__),(__y__))
311  #define NTV2_CPP_MAX(__x__,__y__) max((__x__),(__y__))
312  #pragma warning(disable:4996) // Sadly MSVC bitches about DECLARING a deprecated function but not about USING one.
313 
315 #elif defined (AJAMac)
316  #include <stdint.h>
318  typedef short HANDLE;
319  typedef void* PVOID;
320  typedef unsigned int BOOL_;
321  typedef ULWord UWord_;
322  typedef int Fixed_;
323  typedef int AJASocket;
324 
325  #define AJATargetBigEndian 0
326  #define AJAFUNC __func__
327  #define NTV2_CPP_MIN(__x__,__y__) std::min((__x__),(__y__))
328  #define NTV2_CPP_MAX(__x__,__y__) std::max((__x__),(__y__))
329 
330  #define MAX_PATH 4096
331 
332  #define INVALID_HANDLE_VALUE (0)
333 
334  #if !defined (NTV2_DEPRECATE)
335  typedef struct {
336  int cx;
337  int cy;
338  } SIZE;
339  #endif // !defined (NTV2_DEPRECATE)
340 
341  #define POINTER_32
342 
344 #elif defined (AJALinux)
345  /* As of kernel 2.6.19, the C type _Bool is typedefed to bool to allow
347  * generic booleans in the kernel. Unfortunately, we #define bool
348  * here and true and false there, so this fixes it ... until next time
349  * -JAC 3/6/2007 */
350  #ifdef __KERNEL__
351  #include "linux/version.h"
352  #include "linux/kernel.h"
353  #if defined (RHEL5) || (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,19))
354  #include "linux/types.h"
355  #else/* LINUX_VERSION_CODE */
356  typedef unsigned char bool;
357  #endif /* LINUX_VERSION_CODE */
358  #endif /* __KERNEL__ */
359 
360  #if defined (MODULE)
361  #define NTV2_BUILDING_DRIVER
362  #undef NTV2_USE_CPLUSPLUS11
363  #endif
364 
365  #if !defined (NTV2_BUILDING_DRIVER)
366  #include <stdint.h>
367  typedef int64_t HANDLE;
368  typedef uint64_t ULWord64;
369  typedef uint64_t Pointer64;
370  typedef int64_t LWord64;
371  typedef void * PVOID;
372  typedef void * LPVOID;
373  typedef int32_t Fixed_;
374  typedef bool BOOL_;
375  typedef bool BOOL;
376  typedef UWord UWord_;
377  typedef uint32_t DWORD; /* 32 bits on 32 or 64 bit CPUS */
378 
379  typedef int32_t AJASocket;
380  #define NTV2_CPP_MIN(__x__,__y__) std::min((__x__),(__y__))
381  #define NTV2_CPP_MAX(__x__,__y__) std::max((__x__),(__y__))
382  #else
383  #if defined (AJAVirtual)
384  #include <stdbool.h>
385  #include <stdint.h>
386  #endif
387  typedef long HANDLE;
388  // this is what is is in Windows:
389  // typedef void * HANDLE;
390  typedef unsigned long long ULWord64;
391  typedef unsigned long long Pointer64;
392  typedef signed long long LWord64;
393  typedef void * PVOID;
394  typedef void * LPVOID;
395  typedef LWord Fixed_;
396  typedef bool BOOL_;
397  typedef bool BOOL;
398  typedef UWord UWord_;
399  typedef unsigned int DWORD; /* 32 bits on 32 or 64 bit CPUS */
400 
401  typedef int AJASocket;
402  #endif
403 
404  #define AJATargetBigEndian 0
405  #define AJAFUNC __func__
406 
407  #if !defined (NTV2_DEPRECATE)
408  typedef struct {
409  int cx;
410  int cy;
411  } SIZE;
412  #endif // !defined (NTV2_DEPRECATE)
413 
414  typedef struct {
415  int left;
416  int right;
417  int top;
418  int bottom;
419  } RECT;
420 
421  #ifndef INVALID_HANDLE_VALUE
422  #define INVALID_HANDLE_VALUE (-1L)
423  #endif
424  #define WINAPI
425  #define POINTER_32
426  #define MAX_PATH 4096
427 #elif defined (AJA_BAREMETAL)
429  #include <stdint.h>
431  typedef short HANDLE;
432  typedef void* PVOID;
433  typedef unsigned int BOOL_;
434  typedef ULWord UWord_;
435  typedef int Fixed_;
436  typedef int AJASocket;
437 
438  #define AJATargetBigEndian 0
439  #define AJAFUNC __func__
440  #define NTV2_CPP_MIN(__x__,__y__) std::min((__x__),(__y__))
441  #define NTV2_CPP_MAX(__x__,__y__) std::max((__x__),(__y__))
442 
443  #define MAX_PATH 4096
444 
445  #undef NTV2_WRITEREG_PROFILING // disable register write profiling
446 
447  #define INVALID_HANDLE_VALUE (0)
448 
449  #if !defined (NTV2_DEPRECATE)
450  typedef struct {
451  int cx;
452  int cy;
453  } SIZE;
454  #endif // !defined (NTV2_DEPRECATE)
455 
456  #define POINTER_32
457 
458 #else
459  #error "IMPLEMENT OTHER PLATFORM"
461 
462 #endif // end OTHER PLATFORM
463 
464 #if defined (NTV2_BUILDING_DRIVER)
465  // The AJA NTV2 driver is always built without any deprecated types or functions:
466  #if !defined(NTV2_DEPRECATE_16_0)
467  #define NTV2_DEPRECATE_16_0
468  #endif
469  #if !defined(NTV2_DEPRECATE_16_1)
470  #define NTV2_DEPRECATE_16_1
471  #endif
472  #if !defined(NTV2_DEPRECATE_16_2)
473  #define NTV2_DEPRECATE_16_2
474  #endif
475  #if !defined(NTV2_DEPRECATE_16_3)
476  #define NTV2_DEPRECATE_16_3
477  #endif
478 #endif
479 
480 
484 #if !defined (NTV2_ASSERT)
485  #if defined (NTV2_BUILDING_DRIVER)
486  // Kernel space NTV2_ASSERTs
487  #if defined (AJA_DEBUG) || defined (_DEBUG)
488  #if defined (MSWindows)
489  #define NTV2_ASSERT(_expr_) ASSERT (#_expr_)
490  #elif defined (AJAMac)
491  #define NTV2_ASSERT(_expr_) assert (_expr_)
492  #elif defined (AJALinux)
493  #define NTV2_ASSERT(_expr_) do {if (#_expr_) break; \
494  printk (KERN_EMERG "### NTV2_ASSERT '%s': %s: line %d: %s\n", \
495  __FILE__, __func__, __LINE__, #_expr_); dump_stack(); \
496  } while (0)
497  #else
498  #define NTV2_ASSERT(_expr_)
499  #endif
500  #else
501  #define NTV2_ASSERT(_expr_)
502  #endif
503  #else
504  // User space NTV2_ASSERTs
505  #if defined (AJA_DEBUG) || defined (_DEBUG)
506  #include <assert.h>
507  #define NTV2_ASSERT(_expr_) assert (_expr_)
508  #else
509  #define NTV2_ASSERT(_expr_) (void) (_expr_)
510  #endif
511  #endif // else !defined (NTV2_BUILDING_DRIVER)
512 #endif // if NTV2_ASSERT undefined
513 
514 
518 // These implement compile-time warnings for use of deprecated variables and functions
519 #define NTV2_DEPRECATED_INLINE // Just a marker/reminder
520 #define NTV2_DEPRECATED_FIELD // Just a marker/reminder
521 #define NTV2_DEPRECATED_VARIABLE // Just a marker/reminder
522 #define NTV2_DEPRECATED_TYPEDEF // Just a marker/reminder
523 #define NTV2_DEPRECATED_CLASS // Just a marker/reminder
524 #define NTV2_SHOULD_BE_DEPRECATED(__f__) __f__
525 #define NTV2_SHOULD_DEPRECATE(__f__) __f__
526 #define NTV2_MUST_DEPRECATE(__f__) __f__
527 #define NTV2_WILL_BE_DEPRECATED(__f__) __f__
528 #if defined(NTV2_BUILDING_DRIVER)
529  // Disable deprecation warnings in driver builds
530  #define NTV2_DEPRECATED_f(__f__) __f__
531  #define NTV2_DEPRECATED_v(__v__) __v__
532  #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__)
533 #elif defined(_MSC_VER) && _MSC_VER >= 1600
534  // Use __declspec(deprecated) for MSVC
535  #define NTV2_DEPRECATED_f(__f__) __declspec(deprecated) __f__
536  #define NTV2_DEPRECATED_v(__v__) __v__
537  #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__)
538 #elif defined(__clang__)
539  // Use __attribute__((deprecated)) for LLVM/Clang
540  #define NTV2_DEPRECATED_f(__f__) __f__ __attribute__((deprecated))
541  #define NTV2_DEPRECATED_v(__v__) __v__
542  #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__)
543 #elif defined(__GNUC__)
544  #if __GNUC__ >= 4
545  // Use __attribute__((deprecated)) for GCC 4 or later
546  #define NTV2_DEPRECATED_f(__f__) __f__ __attribute__ ((deprecated))
547  #define NTV2_DEPRECATED_v(__v__) __v__
548  #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__)
549  #else
550  // Disable deprecation warnings in GCC prior to GCC 4
551  #define NTV2_DEPRECATED_f(__f__) __f__
552  #define NTV2_DEPRECATED_v(__v__) __v__
553  #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__)
554  #endif
555 #else
556  // Disable deprecation warnings
557  #define NTV2_DEPRECATED_f(__f__) __f__
558  #define NTV2_DEPRECATED_v(__v__) __v__
559  #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__)
560 #endif
561 
562 
563 #if !defined(BIT)
564  #if !defined(AJALinux)
565  #define BIT(_x_) (1u << (_x_))
566  #else // Linux:
567  // As of kernel 2.6.24, BIT is defined in the kernel source (linux/bitops.h).
568  // By making that definition match the one in the kernel source *exactly*
569  // we supress compiler warnings (thanks Shaun)
570  #define BIT(nr) (1UL << (nr))
571  #endif // AJALinux
572 #endif
573 #if 1
574  #define BIT_0 (1u<<0)
575  #define BIT_1 (1u<<1)
576  #define BIT_2 (1u<<2)
577  #define BIT_3 (1u<<3)
578  #define BIT_4 (1u<<4)
579  #define BIT_5 (1u<<5)
580  #define BIT_6 (1u<<6)
581  #define BIT_7 (1u<<7)
582  #define BIT_8 (1u<<8)
583  #define BIT_9 (1u<<9)
584  #define BIT_10 (1u<<10)
585  #define BIT_11 (1u<<11)
586  #define BIT_12 (1u<<12)
587  #define BIT_13 (1u<<13)
588  #define BIT_14 (1u<<14)
589  #define BIT_15 (1u<<15)
590  #define BIT_16 (1u<<16)
591  #define BIT_17 (1u<<17)
592  #define BIT_18 (1u<<18)
593  #define BIT_19 (1u<<19)
594  #define BIT_20 (1u<<20)
595  #define BIT_21 (1u<<21)
596  #define BIT_22 (1u<<22)
597  #define BIT_23 (1u<<23)
598  #define BIT_24 (1u<<24)
599  #define BIT_25 (1u<<25)
600  #define BIT_26 (1u<<26)
601  #define BIT_27 (1u<<27)
602  #define BIT_28 (1u<<28)
603  #define BIT_29 (1u<<29)
604  #define BIT_30 (1u<<30)
605  #define BIT_31 (1u<<31)
606 #endif // 1
607 
608 #if 0
609 // Check at compile time if all the defined types are the correct size
610 // must support C++11 for this to work
611 static_assert(sizeof(bool) == 1, "bool: size is not correct");
612 static_assert(sizeof(int8_t) == 1, "int8_t: size is not correct");
613 static_assert(sizeof(int16_t) == 2, "int16_t: size is not correct");
614 static_assert(sizeof(int32_t) == 4, "int32_t: size is not correct");
615 static_assert(sizeof(int64_t) == 8, "int64_t: size is not correct");
616 static_assert(sizeof(uint8_t) == 1, "uint8_t: size is not correct");
617 static_assert(sizeof(uint16_t) == 2, "uint16_t: size is not correct");
618 static_assert(sizeof(uint32_t) == 4, "uint32_t: size is not correct");
619 static_assert(sizeof(uint64_t) == 8, "uint64_t: size is not correct");
620 
621 static_assert(sizeof(LWord) == 4, "LWord: size is not correct");
622 static_assert(sizeof(ULWord) == 4, "ULWord: size is not correct");
623 static_assert(sizeof(PULWord) == 8, "PULWord: size is not correct");
624 static_assert(sizeof(Word) == 2, "Word: size is not correct");
625 static_assert(sizeof(UWord) == 2, "UWord: size is not correct");
626 static_assert(sizeof(UByte) == 1, "UByte: size is not correct");
627 static_assert(sizeof(SByte) == 1, "SByte: size is not correct");
628 
629 static_assert(sizeof(ULWord64) == 8, "ULWord64: size is not correct");
630 static_assert(sizeof(Pointer64) == 8, "Pointer64: size is not correct");
631 static_assert(sizeof(LWord64) == 8, "LWord64: size is not correct");
632 static_assert(sizeof(PVOID) == 8, "PVOID: size is not correct");
633 static_assert(sizeof(Fixed_) == 4, "Fixed_: size is not correct");
634 
635 // ideally these whould be the same across the platforms but historically they have not been
636 #if defined(MSWindows)
637 static_assert(sizeof(HANDLE) == 8, "HANDLE: size is not correct");
638 static_assert(sizeof(BOOL) == 4, "BOOL: size is not correct");
639 static_assert(sizeof(BOOL_) == 1, "BOOL_: size is not correct");
640 static_assert(sizeof(AJASocket) == 8, "AJASocket: size is not correct");
641 static_assert(sizeof(UWord_) == 2, "UWord_: size is not correct");
642 static_assert(sizeof(LPVOID) == 8, "LPVOID: size is not correct");
643 static_assert(sizeof(DWORD) == 4, "DWORD: size is not correct");
644 #elif defined(AJAMac)
645 static_assert(sizeof(HANDLE) == 2, "HANDLE: size is not correct");
646 //static_assert(sizeof(BOOL) == 1, "BOOL: size is not correct");
647 static_assert(sizeof(BOOL_) == 4, "BOOL_: size is not correct");
648 static_assert(sizeof(AJASocket) == 4, "AJASocket: size is not correct");
649 static_assert(sizeof(UWord_) == 4, "UWord_: size is not correct");
650 //static_assert(sizeof(LPVOID) == 8, "LPVOID: size is not correct");
651 //static_assert(sizeof(DWORD) == 4, "DWORD: size is not correct");
652 #elif defined(AJALinux)
653 static_assert(sizeof(HANDLE) == 8, "HANDLE: size is not correct");
654 static_assert(sizeof(BOOL) == 1, "BOOL: size is not correct");
655 static_assert(sizeof(BOOL_) == 1, "BOOL_: size is not correct");
656 static_assert(sizeof(AJASocket) == 4, "AJASocket: size is not correct");
657 static_assert(sizeof(UWord_) == 2, "UWord_: size is not correct");
658 static_assert(sizeof(LPVOID) == 8, "LPVOID: size is not correct");
659 static_assert(sizeof(DWORD) == 4, "DWORD: size is not correct");
660 #endif
661 
662 #endif
663 
664 #endif // AJATYPES_H
SByte
int8_t SByte
Definition: ajatypes.h:252
LWord
int32_t LWord
Definition: ajatypes.h:255
HANDLE
short HANDLE
Definition: ajatypes.h:318
PULWord
uint32_t * PULWord
Definition: ajatypes.h:257
BOOL_
unsigned int BOOL_
Definition: ajatypes.h:320
ULWord
uint32_t ULWord
Definition: ajatypes.h:256
Pointer64
uint64_t Pointer64
Definition: ajatypes.h:260
UWord
uint16_t UWord
Definition: ajatypes.h:254
PVOID
void * PVOID
Definition: ajatypes.h:319
Word
int16_t Word
Definition: ajatypes.h:253
UWord_
ULWord UWord_
Definition: ajatypes.h:321
LWord64
int64_t LWord64
Definition: ajatypes.h:258
AJASocket
int AJASocket
Definition: ajatypes.h:323
UByte
uint8_t UByte
Definition: ajatypes.h:251
ULWord64
uint64_t ULWord64
Definition: ajatypes.h:259
Fixed_
int Fixed_
Definition: ajatypes.h:322