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