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