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) 136 #define NTV2_CHECK_SDRAM_COLLISIONS 143 #define AJA_VIRTUAL virtual // Force use of virtual functions in CNTV2Card, etc. 144 #define AJA_STATIC static // Do not change this. 145 #define NTV2_UNUSED(__p__) (void)__p__ 147 #if defined(__CPLUSPLUS__) || defined(__cplusplus) 149 #if defined(__clang__) 150 #ifndef __has_feature 151 #define __has_feature(__x__) 0 153 #if __has_feature(cxx_nullptr) 154 #define AJA_CXX11_NULLPTR_AVAILABLE 157 #elif defined(AJALinux) 158 #if defined(__clang__) 159 #ifndef __has_feature 160 #define __has_feature(__x__) 0 162 #if __has_feature(cxx_nullptr) 163 #define AJA_CXX11_NULLPTR_AVAILABLE 165 #elif defined(__GNUC__) 166 #if __cplusplus >= 201103L // C++11 or later 167 #define AJA_CXX11_NULLPTR_AVAILABLE 170 #elif defined(MSWindows) 171 #if defined(_MSC_VER) && _MSC_VER >= 1700 // VS2012 or later: 172 #define AJA_CXX11_NULLPTR_AVAILABLE 177 #if defined(AJA_CXX11_NULLPTR_AVAILABLE) 178 #define AJA_NULL nullptr 180 #define AJA_NULL NULL 183 #if defined(__clang__) 184 #ifndef __has_cpp_attribute 185 #define __has_cpp_attribute(__x__) 0 188 #if __has_cpp_attribute(clang::fallthrough) 189 #define AJA_FALL_THRU [[clang::fallthrough]] 191 #define AJA_FALL_THRU 193 #elif defined(__GNUC__) 195 #define AJA_FALL_THRU [[gnu::fallthrough]] 197 #define AJA_FALL_THRU 200 #define AJA_FALL_THRU 204 #if defined (NTV2_USE_STDINT) 205 #if defined (MSWindows) 206 #define _WINSOCK_DEPRECATED_NO_WARNINGS 1 207 #if (_MSC_VER < 1300) 208 typedef signed char int8_t;
209 typedef signed short int16_t;
210 typedef signed int int32_t;
211 typedef unsigned char uint8_t;
212 typedef unsigned short uint16_t;
213 typedef unsigned int uint32_t;
215 #if defined (NTV2_BUILDING_DRIVER) 216 typedef signed __int8 int8_t;
217 typedef signed __int16 int16_t;
218 typedef signed __int32 int32_t;
219 typedef unsigned __int8 uint8_t;
220 typedef unsigned __int16 uint16_t;
221 typedef unsigned __int32 uint32_t;
226 typedef signed __int64 int64_t;
227 typedef unsigned __int64 uint64_t;
243 typedef unsigned int ULWord;
244 typedef unsigned int *
PULWord;
246 typedef unsigned short UWord;
247 typedef unsigned char UByte;
253 #if defined (MSWindows) 254 #define _WINSOCK_DEPRECATED_NO_WARNINGS 1 257 #if !defined (NTV2_BUILDING_DRIVER) 258 #ifndef WIN32_LEAN_AND_MEAN 259 #define WIN32_LEAN_AND_MEAN 264 #if defined(DeviceCapabilities) 265 #undef DeviceCapabilities 269 typedef unsigned char Boolean;
277 typedef signed __int8 int8_t;
278 typedef signed __int16 int16_t;
279 typedef signed __int32 int32_t;
280 typedef signed __int64 int64_t;
281 typedef unsigned __int8 uint8_t;
282 typedef unsigned __int16 uint16_t;
283 typedef unsigned __int32 uint32_t;
284 typedef unsigned __int64 uint64_t;
288 #define AJATargetBigEndian 0 289 #define AJAFUNC __FUNCTION__ 290 #define NTV2_CPP_MIN(__x__,__y__) min((__x__),(__y__)) 291 #define NTV2_CPP_MAX(__x__,__y__) max((__x__),(__y__)) 292 #pragma warning(disable:4996) // Sadly MSVC bitches about DECLARING a deprecated function but not about USING one. 295 #elif defined (AJAMac) 305 #define AJATargetBigEndian 0 306 #define AJAFUNC __func__ 307 #define NTV2_CPP_MIN(__x__,__y__) std::min((__x__),(__y__)) 308 #define NTV2_CPP_MAX(__x__,__y__) std::max((__x__),(__y__)) 310 #define MAX_PATH 4096 312 #define INVALID_HANDLE_VALUE (0) 314 #if !defined (NTV2_DEPRECATE) 319 #endif // !defined (NTV2_DEPRECATE) 324 #elif defined (AJALinux) 331 #include "linux/version.h" 332 #include "linux/kernel.h" 333 #if defined (RHEL5) || (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,19)) 334 #include "linux/types.h" 336 typedef unsigned char bool;
341 #define NTV2_BUILDING_DRIVER 342 #undef NTV2_USE_CPLUSPLUS11 345 #if !defined (NTV2_BUILDING_DRIVER) 351 typedef void *
PVOID;
352 typedef void * LPVOID;
357 typedef uint32_t DWORD;
360 #define NTV2_CPP_MIN(__x__,__y__) std::min((__x__),(__y__)) 361 #define NTV2_CPP_MAX(__x__,__y__) std::max((__x__),(__y__)) 363 #if defined (AJAVirtual) 370 typedef unsigned long long ULWord64;
372 typedef signed long long LWord64;
373 typedef void *
PVOID;
374 typedef void * LPVOID;
379 typedef unsigned int DWORD;
384 #define AJATargetBigEndian 0 385 #define AJAFUNC __func__ 387 #if !defined (NTV2_DEPRECATE) 392 #endif // !defined (NTV2_DEPRECATE) 401 #ifndef INVALID_HANDLE_VALUE 402 #define INVALID_HANDLE_VALUE (-1L) 406 #define MAX_PATH 4096 407 #elif defined (AJA_BAREMETAL) 413 typedef unsigned int BOOL_;
418 #define AJATargetBigEndian 0 419 #define AJAFUNC __func__ 420 #define NTV2_CPP_MIN(__x__,__y__) std::min((__x__),(__y__)) 421 #define NTV2_CPP_MAX(__x__,__y__) std::max((__x__),(__y__)) 423 #define MAX_PATH 4096 425 #undef NTV2_WRITEREG_PROFILING // disable register write profiling 427 #define INVALID_HANDLE_VALUE (0) 429 #if !defined (NTV2_DEPRECATE) 434 #endif // !defined (NTV2_DEPRECATE) 439 #error "IMPLEMENT OTHER PLATFORM" 442 #endif // end OTHER PLATFORM 444 #if defined (NTV2_BUILDING_DRIVER) 446 #if !defined(NTV2_DEPRECATE_16_0) 447 #define NTV2_DEPRECATE_16_0 449 #if !defined(NTV2_DEPRECATE_16_1) 450 #define NTV2_DEPRECATE_16_1 452 #if !defined(NTV2_DEPRECATE_16_2) 453 #define NTV2_DEPRECATE_16_2 455 #if !defined(NTV2_DEPRECATE_16_3) 456 #define NTV2_DEPRECATE_16_3 458 #endif // defined (NTV2_BUILDING_DRIVER) 464 #if !defined (NTV2_ASSERT) 465 #if defined (NTV2_BUILDING_DRIVER) 467 #if defined (AJA_DEBUG) || defined (_DEBUG) 468 #if defined (MSWindows) 469 #define NTV2_ASSERT(_expr_) ASSERT (#_expr_) 470 #elif defined (AJAMac) 471 #define NTV2_ASSERT(_expr_) assert (_expr_) 472 #elif defined (AJALinux) 473 #define NTV2_ASSERT(_expr_) do {if (#_expr_) break; \ 474 printk (KERN_EMERG "### NTV2_ASSERT '%s': %s: line %d: %s\n", \ 475 __FILE__, __func__, __LINE__, #_expr_); dump_stack(); \ 478 #define NTV2_ASSERT(_expr_) 481 #define NTV2_ASSERT(_expr_) 485 #if defined (AJA_DEBUG) || defined (_DEBUG) 487 #define NTV2_ASSERT(_expr_) assert (_expr_) 489 #define NTV2_ASSERT(_expr_) (void) (_expr_) 491 #endif // else !defined (NTV2_BUILDING_DRIVER) 492 #endif // if NTV2_ASSERT undefined 499 #define NTV2_DEPRECATED_INLINE // Just a marker/reminder 500 #define NTV2_DEPRECATED_FIELD // Just a marker/reminder 501 #define NTV2_DEPRECATED_VARIABLE // Just a marker/reminder 502 #define NTV2_DEPRECATED_TYPEDEF // Just a marker/reminder 503 #define NTV2_DEPRECATED_CLASS // Just a marker/reminder 504 #define NTV2_SHOULD_BE_DEPRECATED(__f__) __f__ 505 #define NTV2_SHOULD_DEPRECATE(__f__) __f__ 506 #define NTV2_MUST_DEPRECATE(__f__) __f__ 507 #define NTV2_WILL_BE_DEPRECATED(__f__) __f__ 508 #if defined(NTV2_BUILDING_DRIVER) 510 #define NTV2_DEPRECATED_f(__f__) __f__ 511 #define NTV2_DEPRECATED_v(__v__) __v__ 512 #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__) 513 #elif defined(_MSC_VER) && _MSC_VER >= 1600 515 #define NTV2_DEPRECATED_f(__f__) __declspec(deprecated) __f__ 516 #define NTV2_DEPRECATED_v(__v__) __v__ 517 #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__) 518 #elif defined(__clang__) 520 #define NTV2_DEPRECATED_f(__f__) __f__ __attribute__((deprecated)) 521 #define NTV2_DEPRECATED_v(__v__) __v__ 522 #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__) 523 #elif defined(__GNUC__) 526 #define NTV2_DEPRECATED_f(__f__) __f__ __attribute__ ((deprecated)) 527 #define NTV2_DEPRECATED_v(__v__) __v__ 528 #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__) 531 #define NTV2_DEPRECATED_f(__f__) __f__ 532 #define NTV2_DEPRECATED_v(__v__) __v__ 533 #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__) 537 #define NTV2_DEPRECATED_f(__f__) __f__ 538 #define NTV2_DEPRECATED_v(__v__) __v__ 539 #define NTV2_DEPRECATED_vi(__v__, __i__) __v__ = (__i__) 542 #define NTV2_DEPRECATED_16_0(__f__) NTV2_DEPRECATED_f(__f__) 543 #if defined(NTV2_DEPRECATE_16_0) 544 #define NTV2_DEPRECATED_16_1(__f__) NTV2_DEPRECATED_f(__f__) 545 #else//NTV2_DEPRECATE_16_0 546 #define NTV2_DEPRECATED_16_1(__f__) NTV2_WILL_BE_DEPRECATED(__f__) 547 #endif//NTV2_DEPRECATE_16_0 548 #if defined(NTV2_DEPRECATE_16_1) 549 #define NTV2_DEPRECATED_16_2(__f__) NTV2_DEPRECATED_f(__f__) 550 #else//NTV2_DEPRECATE_16_1 551 #define NTV2_DEPRECATED_16_2(__f__) NTV2_WILL_BE_DEPRECATED(__f__) 552 #endif//NTV2_DEPRECATE_16_1 553 #if defined(NTV2_DEPRECATE_16_2) 554 #define NTV2_DEPRECATED_16_3(__f__) NTV2_DEPRECATED_f(__f__) 555 #else//NTV2_DEPRECATE_16_2 556 #define NTV2_DEPRECATED_16_3(__f__) NTV2_WILL_BE_DEPRECATED(__f__) 557 #endif//NTV2_DEPRECATE_16_2 558 #if defined(NTV2_DEPRECATE_16_3) 559 #define NTV2_DEPRECATED_17_0(__f__) NTV2_DEPRECATED_f(__f__) 560 #else//NTV2_DEPRECATE_16_3 561 #define NTV2_DEPRECATED_17_0(__f__) NTV2_WILL_BE_DEPRECATED(__f__) 562 #endif//NTV2_DEPRECATE_16_3 563 #if defined(NTV2_DEPRECATE_17_0) 564 #define NTV2_DEPRECATED_17_1(__f__) NTV2_DEPRECATED_f(__f__) 565 #else//NTV2_DEPRECATE_17_0 566 #define NTV2_DEPRECATED_17_1(__f__) NTV2_WILL_BE_DEPRECATED(__f__) 567 #endif//NTV2_DEPRECATE_17_0 568 #if defined(NTV2_DEPRECATE_17_1) 569 #define NTV2_DEPRECATED_17_2(__f__) NTV2_DEPRECATED_f(__f__) 570 #else//NTV2_DEPRECATE_17_1 571 #define NTV2_DEPRECATED_17_2(__f__) NTV2_WILL_BE_DEPRECATED(__f__) 572 #endif//NTV2_DEPRECATE_17_1 573 #if defined(NTV2_DEPRECATE_17_2) 574 #define NTV2_DEPRECATED_17_5(__f__) NTV2_DEPRECATED_f(__f__) 575 #else//NTV2_DEPRECATE_17_2 576 #define NTV2_DEPRECATED_17_5(__f__) NTV2_WILL_BE_DEPRECATED(__f__) 577 #endif//NTV2_DEPRECATE_17_2 578 #if defined(NTV2_DEPRECATE_17_5) 579 #define NTV2_DEPRECATED_17_6(__f__) NTV2_DEPRECATED_f(__f__) 580 #else//NTV2_DEPRECATE_17_5 581 #define NTV2_DEPRECATED_17_6(__f__) NTV2_WILL_BE_DEPRECATED(__f__) 582 #endif//NTV2_DEPRECATE_17_5 583 #if defined(NTV2_DEPRECATE_17_6) 584 #define NTV2_DEPRECATED_18_0(__f__) NTV2_DEPRECATED_f(__f__) 585 #else//NTV2_DEPRECATE_17_6 586 #define NTV2_DEPRECATED_18_0(__f__) NTV2_WILL_BE_DEPRECATED(__f__) 587 #endif//NTV2_DEPRECATE_17_6 588 #if defined(NTV2_DEPRECATE_18_0) 589 #define NTV2_DEPRECATED_18_1(__f__) NTV2_DEPRECATED_f(__f__) 590 #else//NTV2_DEPRECATE_18_0 591 #define NTV2_DEPRECATED_18_1(__f__) NTV2_WILL_BE_DEPRECATED(__f__) 592 #endif//NTV2_DEPRECATE_18_0 595 #if !defined(AJALinux) 596 #define BIT(_x_) (1u << (_x_)) 601 #define BIT(nr) (1UL << (nr)) 605 #define BIT_0 (1u<<0) 606 #define BIT_1 (1u<<1) 607 #define BIT_2 (1u<<2) 608 #define BIT_3 (1u<<3) 609 #define BIT_4 (1u<<4) 610 #define BIT_5 (1u<<5) 611 #define BIT_6 (1u<<6) 612 #define BIT_7 (1u<<7) 613 #define BIT_8 (1u<<8) 614 #define BIT_9 (1u<<9) 615 #define BIT_10 (1u<<10) 616 #define BIT_11 (1u<<11) 617 #define BIT_12 (1u<<12) 618 #define BIT_13 (1u<<13) 619 #define BIT_14 (1u<<14) 620 #define BIT_15 (1u<<15) 621 #define BIT_16 (1u<<16) 622 #define BIT_17 (1u<<17) 623 #define BIT_18 (1u<<18) 624 #define BIT_19 (1u<<19) 625 #define BIT_20 (1u<<20) 626 #define BIT_21 (1u<<21) 627 #define BIT_22 (1u<<22) 628 #define BIT_23 (1u<<23) 629 #define BIT_24 (1u<<24) 630 #define BIT_25 (1u<<25) 631 #define BIT_26 (1u<<26) 632 #define BIT_27 (1u<<27) 633 #define BIT_28 (1u<<28) 634 #define BIT_29 (1u<<29) 635 #define BIT_30 (1u<<30) 636 #define BIT_31 (1u<<31) 642 static_assert(
sizeof(
bool) == 1,
"bool: size is not correct");
643 static_assert(
sizeof(int8_t) == 1,
"int8_t: size is not correct");
644 static_assert(
sizeof(int16_t) == 2,
"int16_t: size is not correct");
645 static_assert(
sizeof(int32_t) == 4,
"int32_t: size is not correct");
646 static_assert(
sizeof(int64_t) == 8,
"int64_t: size is not correct");
647 static_assert(
sizeof(uint8_t) == 1,
"uint8_t: size is not correct");
648 static_assert(
sizeof(uint16_t) == 2,
"uint16_t: size is not correct");
649 static_assert(
sizeof(uint32_t) == 4,
"uint32_t: size is not correct");
650 static_assert(
sizeof(uint64_t) == 8,
"uint64_t: size is not correct");
652 static_assert(
sizeof(
LWord) == 4,
"LWord: size is not correct");
653 static_assert(
sizeof(
ULWord) == 4,
"ULWord: size is not correct");
654 static_assert(
sizeof(
PULWord) == 8,
"PULWord: size is not correct");
655 static_assert(
sizeof(
Word) == 2,
"Word: size is not correct");
656 static_assert(
sizeof(
UWord) == 2,
"UWord: size is not correct");
657 static_assert(
sizeof(
UByte) == 1,
"UByte: size is not correct");
658 static_assert(
sizeof(
SByte) == 1,
"SByte: size is not correct");
660 static_assert(
sizeof(
ULWord64) == 8,
"ULWord64: size is not correct");
661 static_assert(
sizeof(
Pointer64) == 8,
"Pointer64: size is not correct");
662 static_assert(
sizeof(
LWord64) == 8,
"LWord64: size is not correct");
663 static_assert(
sizeof(
PVOID) == 8,
"PVOID: size is not correct");
664 static_assert(
sizeof(
Fixed_) == 4,
"Fixed_: size is not correct");
667 #if defined(MSWindows) 668 static_assert(
sizeof(
HANDLE) == 8,
"HANDLE: size is not correct");
669 static_assert(
sizeof(BOOL) == 4,
"BOOL: size is not correct");
670 static_assert(
sizeof(
BOOL_) == 1,
"BOOL_: size is not correct");
671 static_assert(
sizeof(
AJASocket) == 8,
"AJASocket: size is not correct");
672 static_assert(
sizeof(
UWord_) == 2,
"UWord_: size is not correct");
673 static_assert(
sizeof(LPVOID) == 8,
"LPVOID: size is not correct");
674 static_assert(
sizeof(DWORD) == 4,
"DWORD: size is not correct");
675 #elif defined(AJAMac) 676 static_assert(
sizeof(
HANDLE) == 2,
"HANDLE: size is not correct");
678 static_assert(
sizeof(
BOOL_) == 4,
"BOOL_: size is not correct");
679 static_assert(
sizeof(
AJASocket) == 4,
"AJASocket: size is not correct");
680 static_assert(
sizeof(
UWord_) == 4,
"UWord_: size is not correct");
683 #elif defined(AJALinux) 684 static_assert(
sizeof(
HANDLE) == 8,
"HANDLE: size is not correct");
685 static_assert(
sizeof(BOOL) == 1,
"BOOL: size is not correct");
686 static_assert(
sizeof(
BOOL_) == 1,
"BOOL_: size is not correct");
687 static_assert(
sizeof(
AJASocket) == 4,
"AJASocket: size is not correct");
688 static_assert(
sizeof(
UWord_) == 2,
"UWord_: size is not correct");
689 static_assert(
sizeof(LPVOID) == 8,
"LPVOID: size is not correct");
690 static_assert(
sizeof(DWORD) == 4,
"DWORD: size is not correct");
Deprecation control macros.