12 #define NTV2_USE_STDINT 13 #endif // if not MSWindows 62 #define NTV2_NUB_CLIENT_SUPPORT 74 #define NTV2_WRITEREG_PROFILING 90 #if !defined(NTV2_USE_CPLUSPLUS11) 91 #define NTV2_USE_CPLUSPLUS11 92 #endif // !defined(NTV2_USE_CPLUSPLUS11) 130 #define AJA_VIRTUAL virtual // Force use of virtual functions in CNTV2Card, etc. 131 #define AJA_STATIC static // Do not change this. 132 #define NTV2_UNUSED(__p__) (void)__p__ 134 #if defined(__CPLUSPLUS__) || defined(__cplusplus) 136 #if defined(__clang__) 137 #ifndef __has_feature 138 #define __has_feature(__x__) 0 140 #if __has_feature(cxx_nullptr) 141 #define AJA_CXX11_NULLPTR_AVAILABLE 144 #elif defined(AJALinux) 145 #if defined(__clang__) 146 #ifndef __has_feature 147 #define __has_feature(__x__) 0 149 #if __has_feature(cxx_nullptr) 150 #define AJA_CXX11_NULLPTR_AVAILABLE 152 #elif defined(__GNUC__) 153 #if __cplusplus >= 201103L // C++11 or later 154 #define AJA_CXX11_NULLPTR_AVAILABLE 157 #elif defined(MSWindows) 158 #if defined(_MSC_VER) && _MSC_VER >= 1700 // VS2012 or later: 159 #define AJA_CXX11_NULLPTR_AVAILABLE 164 #if defined(AJA_CXX11_NULLPTR_AVAILABLE) 165 #define AJA_NULL nullptr 167 #define AJA_NULL NULL 170 #if defined(__clang__) 171 #ifndef __has_cpp_attribute 172 #define __has_cpp_attribute(__x__) 0 175 #if __has_cpp_attribute(clang::fallthrough) 176 #define AJA_FALL_THRU [[clang::fallthrough]] 178 #define AJA_FALL_THRU 180 #elif defined(__GNUC__) 182 #define AJA_FALL_THRU [[gnu::fallthrough]] 184 #define AJA_FALL_THRU 187 #define AJA_FALL_THRU 191 #if defined (NTV2_USE_STDINT) 192 #if defined (MSWindows) 193 #define _WINSOCK_DEPRECATED_NO_WARNINGS 1 194 #if (_MSC_VER < 1300) 195 typedef signed char int8_t;
196 typedef signed short int16_t;
197 typedef signed int int32_t;
198 typedef unsigned char uint8_t;
199 typedef unsigned short uint16_t;
200 typedef unsigned int uint32_t;
202 #if defined (NTV2_BUILDING_DRIVER) 203 typedef signed __int8 int8_t;
204 typedef signed __int16 int16_t;
205 typedef signed __int32 int32_t;
206 typedef unsigned __int8 uint8_t;
207 typedef unsigned __int16 uint16_t;
208 typedef unsigned __int32 uint32_t;
213 typedef signed __int64 int64_t;
214 typedef unsigned __int64 uint64_t;
230 typedef unsigned int ULWord;
231 typedef unsigned int *
PULWord;
233 typedef unsigned short UWord;
234 typedef unsigned char UByte;
240 #if defined (MSWindows) 241 #define _WINSOCK_DEPRECATED_NO_WARNINGS 1 244 #if !defined (NTV2_BUILDING_DRIVER) 245 #ifndef WIN32_LEAN_AND_MEAN 246 #define WIN32_LEAN_AND_MEAN 251 #if defined(DeviceCapabilities) 252 #undef DeviceCapabilities 256 typedef unsigned char Boolean;
264 typedef signed __int8 int8_t;
265 typedef signed __int16 int16_t;
266 typedef signed __int32 int32_t;
267 typedef signed __int64 int64_t;
268 typedef unsigned __int8 uint8_t;
269 typedef unsigned __int16 uint16_t;
270 typedef unsigned __int32 uint32_t;
271 typedef unsigned __int64 uint64_t;
275 #define AJATargetBigEndian 0 276 #define AJAFUNC __FUNCTION__ 277 #define NTV2_CPP_MIN(__x__,__y__) min((__x__),(__y__)) 278 #define NTV2_CPP_MAX(__x__,__y__) max((__x__),(__y__)) 279 #pragma warning(disable:4996) // Sadly MSVC bitches about DECLARING a deprecated function but not about USING one. 282 #elif defined (AJAMac) 292 #define AJATargetBigEndian 0 293 #define AJAFUNC __func__ 294 #define NTV2_CPP_MIN(__x__,__y__) std::min((__x__),(__y__)) 295 #define NTV2_CPP_MAX(__x__,__y__) std::max((__x__),(__y__)) 297 #define MAX_PATH 4096 299 #define INVALID_HANDLE_VALUE (0) 301 #if !defined (NTV2_DEPRECATE) 306 #endif // !defined (NTV2_DEPRECATE) 311 #elif defined (AJALinux) 318 #include "linux/version.h" 319 #include "linux/kernel.h" 320 #if defined (RHEL5) || (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,19)) 321 #include "linux/types.h" 323 typedef unsigned char bool;
328 #define NTV2_BUILDING_DRIVER 329 #undef NTV2_USE_CPLUSPLUS11 332 #if !defined (NTV2_BUILDING_DRIVER) 338 typedef void *
PVOID;
339 typedef void * LPVOID;
344 typedef uint32_t DWORD;
347 #define NTV2_CPP_MIN(__x__,__y__) std::min((__x__),(__y__)) 348 #define NTV2_CPP_MAX(__x__,__y__) std::max((__x__),(__y__)) 350 #if defined (AJAVirtual) 357 typedef unsigned long long ULWord64;
359 typedef signed long long LWord64;
360 typedef void *
PVOID;
361 typedef void * LPVOID;
366 typedef unsigned int DWORD;
371 #define AJATargetBigEndian 0 372 #define AJAFUNC __func__ 374 #if !defined (NTV2_DEPRECATE) 379 #endif // !defined (NTV2_DEPRECATE) 388 #ifndef INVALID_HANDLE_VALUE 389 #define INVALID_HANDLE_VALUE (-1L) 393 #define MAX_PATH 4096 394 #elif defined (AJA_BAREMETAL) 400 typedef unsigned int BOOL_;
405 #define AJATargetBigEndian 0 406 #define AJAFUNC __func__ 407 #define NTV2_CPP_MIN(__x__,__y__) std::min((__x__),(__y__)) 408 #define NTV2_CPP_MAX(__x__,__y__) std::max((__x__),(__y__)) 410 #define MAX_PATH 4096 412 #undef NTV2_WRITEREG_PROFILING // disable register write profiling 414 #define INVALID_HANDLE_VALUE (0) 416 #if !defined (NTV2_DEPRECATE) 421 #endif // !defined (NTV2_DEPRECATE) 426 #error "IMPLEMENT OTHER PLATFORM" 429 #endif // end OTHER PLATFORM 431 #if defined (NTV2_BUILDING_DRIVER) 433 #if !defined(NTV2_DEPRECATE_16_0) 434 #define NTV2_DEPRECATE_16_0 436 #if !defined(NTV2_DEPRECATE_16_1) 437 #define NTV2_DEPRECATE_16_1 439 #if !defined(NTV2_DEPRECATE_16_2) 440 #define NTV2_DEPRECATE_16_2 442 #if !defined(NTV2_DEPRECATE_16_3) 443 #define NTV2_DEPRECATE_16_3 445 #endif // defined (NTV2_BUILDING_DRIVER) 451 #if !defined (NTV2_ASSERT) 452 #if defined (NTV2_BUILDING_DRIVER) 454 #if defined (AJA_DEBUG) || defined (_DEBUG) 455 #if defined (MSWindows) 456 #define NTV2_ASSERT(_expr_) ASSERT (#_expr_) 457 #elif defined (AJAMac) 458 #define NTV2_ASSERT(_expr_) assert (_expr_) 459 #elif defined (AJALinux) 460 #define NTV2_ASSERT(_expr_) do {if (#_expr_) break; \ 461 printk (KERN_EMERG "### NTV2_ASSERT '%s': %s: line %d: %s\n", \ 462 __FILE__, __func__, __LINE__, #_expr_); dump_stack(); \ 465 #define NTV2_ASSERT(_expr_) 468 #define NTV2_ASSERT(_expr_) 472 #if defined (AJA_DEBUG) || defined (_DEBUG) 474 #define NTV2_ASSERT(_expr_) assert (_expr_) 476 #define NTV2_ASSERT(_expr_) (void) (_expr_) 478 #endif // else !defined (NTV2_BUILDING_DRIVER) 479 #endif // if NTV2_ASSERT undefined 486 #define NTV2_DEPRECATED_INLINE // Just a marker/reminder 487 #define NTV2_DEPRECATED_FIELD // Just a marker/reminder 488 #define NTV2_DEPRECATED_VARIABLE // Just a marker/reminder 489 #define NTV2_DEPRECATED_TYPEDEF // Just a marker/reminder 490 #define NTV2_DEPRECATED_CLASS // Just a marker/reminder 491 #define NTV2_SHOULD_BE_DEPRECATED(__f__) __f__ 492 #define NTV2_SHOULD_DEPRECATE(__f__) __f__ 493 #define NTV2_MUST_DEPRECATE(__f__) __f__ 494 #define NTV2_WILL_BE_DEPRECATED(__f__) __f__ 495 #if defined(NTV2_BUILDING_DRIVER) 497 #define NTV2_DEPRECATED_f(__f__) __f__ 498 #define NTV2_DEPRECATED_v(__v__) __v__ 499 #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__) 500 #elif defined(_MSC_VER) && _MSC_VER >= 1600 502 #define NTV2_DEPRECATED_f(__f__) __declspec(deprecated) __f__ 503 #define NTV2_DEPRECATED_v(__v__) __v__ 504 #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__) 505 #elif defined(__clang__) 507 #define NTV2_DEPRECATED_f(__f__) __f__ __attribute__((deprecated)) 508 #define NTV2_DEPRECATED_v(__v__) __v__ 509 #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__) 510 #elif defined(__GNUC__) 513 #define NTV2_DEPRECATED_f(__f__) __f__ __attribute__ ((deprecated)) 514 #define NTV2_DEPRECATED_v(__v__) __v__ 515 #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__) 518 #define NTV2_DEPRECATED_f(__f__) __f__ 519 #define NTV2_DEPRECATED_v(__v__) __v__ 520 #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__) 524 #define NTV2_DEPRECATED_f(__f__) __f__ 525 #define NTV2_DEPRECATED_v(__v__) __v__ 526 #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__) 529 #define NTV2_DEPRECATED_16_0(__f__) NTV2_DEPRECATED_f(__f__) 530 #if defined(NTV2_DEPRECATE_16_0) 531 #define NTV2_DEPRECATED_16_1(__f__) NTV2_DEPRECATED_f(__f__) 532 #else//NTV2_DEPRECATE_16_0 533 #define NTV2_DEPRECATED_16_1(__f__) NTV2_WILL_BE_DEPRECATED(__f__) 534 #endif//NTV2_DEPRECATE_16_0 535 #if defined(NTV2_DEPRECATE_16_1) 536 #define NTV2_DEPRECATED_16_2(__f__) NTV2_DEPRECATED_f(__f__) 537 #else//NTV2_DEPRECATE_16_1 538 #define NTV2_DEPRECATED_16_2(__f__) NTV2_WILL_BE_DEPRECATED(__f__) 539 #endif//NTV2_DEPRECATE_16_1 540 #if defined(NTV2_DEPRECATE_16_2) 541 #define NTV2_DEPRECATED_16_3(__f__) NTV2_DEPRECATED_f(__f__) 542 #else//NTV2_DEPRECATE_16_2 543 #define NTV2_DEPRECATED_16_3(__f__) NTV2_WILL_BE_DEPRECATED(__f__) 544 #endif//NTV2_DEPRECATE_16_2 545 #if defined(NTV2_DEPRECATE_16_3) 546 #define NTV2_DEPRECATED_17_0(__f__) NTV2_DEPRECATED_f(__f__) 547 #else//NTV2_DEPRECATE_16_3 548 #define NTV2_DEPRECATED_17_0(__f__) NTV2_WILL_BE_DEPRECATED(__f__) 549 #endif//NTV2_DEPRECATE_16_3 550 #if defined(NTV2_DEPRECATE_17_0) 551 #define NTV2_DEPRECATED_17_1(__f__) NTV2_DEPRECATED_f(__f__) 552 #else//NTV2_DEPRECATE_17_0 553 #define NTV2_DEPRECATED_17_1(__f__) NTV2_WILL_BE_DEPRECATED(__f__) 554 #endif//NTV2_DEPRECATE_17_0 555 #if defined(NTV2_DEPRECATE_17_1) 556 #define NTV2_DEPRECATED_17_2(__f__) NTV2_DEPRECATED_f(__f__) 557 #else//NTV2_DEPRECATE_17_1 558 #define NTV2_DEPRECATED_17_2(__f__) NTV2_WILL_BE_DEPRECATED(__f__) 559 #endif//NTV2_DEPRECATE_17_1 560 #if defined(NTV2_DEPRECATE_17_2) 561 #define NTV2_DEPRECATED_17_5(__f__) NTV2_DEPRECATED_f(__f__) 562 #else//NTV2_DEPRECATE_17_2 563 #define NTV2_DEPRECATED_17_5(__f__) NTV2_WILL_BE_DEPRECATED(__f__) 564 #endif//NTV2_DEPRECATE_17_2 565 #if defined(NTV2_DEPRECATE_17_5) 566 #define NTV2_DEPRECATED_17_6(__f__) NTV2_DEPRECATED_f(__f__) 567 #else//NTV2_DEPRECATE_17_5 568 #define NTV2_DEPRECATED_17_6(__f__) NTV2_WILL_BE_DEPRECATED(__f__) 569 #endif//NTV2_DEPRECATE_17_5 570 #if defined(NTV2_DEPRECATE_17_6) 571 #define NTV2_DEPRECATED_18_0(__f__) NTV2_DEPRECATED_f(__f__) 572 #else//NTV2_DEPRECATE_17_6 573 #define NTV2_DEPRECATED_18_0(__f__) NTV2_WILL_BE_DEPRECATED(__f__) 574 #endif//NTV2_DEPRECATE_17_6 577 #if !defined(AJALinux) 578 #define BIT(_x_) (1u << (_x_)) 583 #define BIT(nr) (1UL << (nr)) 587 #define BIT_0 (1u<<0) 588 #define BIT_1 (1u<<1) 589 #define BIT_2 (1u<<2) 590 #define BIT_3 (1u<<3) 591 #define BIT_4 (1u<<4) 592 #define BIT_5 (1u<<5) 593 #define BIT_6 (1u<<6) 594 #define BIT_7 (1u<<7) 595 #define BIT_8 (1u<<8) 596 #define BIT_9 (1u<<9) 597 #define BIT_10 (1u<<10) 598 #define BIT_11 (1u<<11) 599 #define BIT_12 (1u<<12) 600 #define BIT_13 (1u<<13) 601 #define BIT_14 (1u<<14) 602 #define BIT_15 (1u<<15) 603 #define BIT_16 (1u<<16) 604 #define BIT_17 (1u<<17) 605 #define BIT_18 (1u<<18) 606 #define BIT_19 (1u<<19) 607 #define BIT_20 (1u<<20) 608 #define BIT_21 (1u<<21) 609 #define BIT_22 (1u<<22) 610 #define BIT_23 (1u<<23) 611 #define BIT_24 (1u<<24) 612 #define BIT_25 (1u<<25) 613 #define BIT_26 (1u<<26) 614 #define BIT_27 (1u<<27) 615 #define BIT_28 (1u<<28) 616 #define BIT_29 (1u<<29) 617 #define BIT_30 (1u<<30) 618 #define BIT_31 (1u<<31) 624 static_assert(
sizeof(
bool) == 1,
"bool: size is not correct");
625 static_assert(
sizeof(int8_t) == 1,
"int8_t: size is not correct");
626 static_assert(
sizeof(int16_t) == 2,
"int16_t: size is not correct");
627 static_assert(
sizeof(int32_t) == 4,
"int32_t: size is not correct");
628 static_assert(
sizeof(int64_t) == 8,
"int64_t: size is not correct");
629 static_assert(
sizeof(uint8_t) == 1,
"uint8_t: size is not correct");
630 static_assert(
sizeof(uint16_t) == 2,
"uint16_t: size is not correct");
631 static_assert(
sizeof(uint32_t) == 4,
"uint32_t: size is not correct");
632 static_assert(
sizeof(uint64_t) == 8,
"uint64_t: size is not correct");
634 static_assert(
sizeof(
LWord) == 4,
"LWord: size is not correct");
635 static_assert(
sizeof(
ULWord) == 4,
"ULWord: size is not correct");
636 static_assert(
sizeof(
PULWord) == 8,
"PULWord: size is not correct");
637 static_assert(
sizeof(
Word) == 2,
"Word: size is not correct");
638 static_assert(
sizeof(
UWord) == 2,
"UWord: size is not correct");
639 static_assert(
sizeof(
UByte) == 1,
"UByte: size is not correct");
640 static_assert(
sizeof(
SByte) == 1,
"SByte: size is not correct");
642 static_assert(
sizeof(
ULWord64) == 8,
"ULWord64: size is not correct");
643 static_assert(
sizeof(
Pointer64) == 8,
"Pointer64: size is not correct");
644 static_assert(
sizeof(
LWord64) == 8,
"LWord64: size is not correct");
645 static_assert(
sizeof(
PVOID) == 8,
"PVOID: size is not correct");
646 static_assert(
sizeof(
Fixed_) == 4,
"Fixed_: size is not correct");
649 #if defined(MSWindows) 650 static_assert(
sizeof(
HANDLE) == 8,
"HANDLE: size is not correct");
651 static_assert(
sizeof(BOOL) == 4,
"BOOL: size is not correct");
652 static_assert(
sizeof(
BOOL_) == 1,
"BOOL_: size is not correct");
653 static_assert(
sizeof(
AJASocket) == 8,
"AJASocket: size is not correct");
654 static_assert(
sizeof(
UWord_) == 2,
"UWord_: size is not correct");
655 static_assert(
sizeof(LPVOID) == 8,
"LPVOID: size is not correct");
656 static_assert(
sizeof(DWORD) == 4,
"DWORD: size is not correct");
657 #elif defined(AJAMac) 658 static_assert(
sizeof(
HANDLE) == 2,
"HANDLE: size is not correct");
660 static_assert(
sizeof(
BOOL_) == 4,
"BOOL_: size is not correct");
661 static_assert(
sizeof(
AJASocket) == 4,
"AJASocket: size is not correct");
662 static_assert(
sizeof(
UWord_) == 4,
"UWord_: size is not correct");
665 #elif defined(AJALinux) 666 static_assert(
sizeof(
HANDLE) == 8,
"HANDLE: size is not correct");
667 static_assert(
sizeof(BOOL) == 1,
"BOOL: size is not correct");
668 static_assert(
sizeof(
BOOL_) == 1,
"BOOL_: size is not correct");
669 static_assert(
sizeof(
AJASocket) == 4,
"AJASocket: size is not correct");
670 static_assert(
sizeof(
UWord_) == 2,
"UWord_: size is not correct");
671 static_assert(
sizeof(LPVOID) == 8,
"LPVOID: size is not correct");
672 static_assert(
sizeof(DWORD) == 4,
"DWORD: size is not correct");
Deprecation control macros.