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 495 #if !defined(AJALinux) 496 #define BIT(_x_) (1u << (_x_)) 501 #define BIT(nr) (1UL << (nr)) 505 #define BIT_0 (1u<<0) 506 #define BIT_1 (1u<<1) 507 #define BIT_2 (1u<<2) 508 #define BIT_3 (1u<<3) 509 #define BIT_4 (1u<<4) 510 #define BIT_5 (1u<<5) 511 #define BIT_6 (1u<<6) 512 #define BIT_7 (1u<<7) 513 #define BIT_8 (1u<<8) 514 #define BIT_9 (1u<<9) 515 #define BIT_10 (1u<<10) 516 #define BIT_11 (1u<<11) 517 #define BIT_12 (1u<<12) 518 #define BIT_13 (1u<<13) 519 #define BIT_14 (1u<<14) 520 #define BIT_15 (1u<<15) 521 #define BIT_16 (1u<<16) 522 #define BIT_17 (1u<<17) 523 #define BIT_18 (1u<<18) 524 #define BIT_19 (1u<<19) 525 #define BIT_20 (1u<<20) 526 #define BIT_21 (1u<<21) 527 #define BIT_22 (1u<<22) 528 #define BIT_23 (1u<<23) 529 #define BIT_24 (1u<<24) 530 #define BIT_25 (1u<<25) 531 #define BIT_26 (1u<<26) 532 #define BIT_27 (1u<<27) 533 #define BIT_28 (1u<<28) 534 #define BIT_29 (1u<<29) 535 #define BIT_30 (1u<<30) 536 #define BIT_31 (1u<<31) 542 static_assert(
sizeof(
bool) == 1,
"bool: size is not correct");
543 static_assert(
sizeof(int8_t) == 1,
"int8_t: size is not correct");
544 static_assert(
sizeof(int16_t) == 2,
"int16_t: size is not correct");
545 static_assert(
sizeof(int32_t) == 4,
"int32_t: size is not correct");
546 static_assert(
sizeof(int64_t) == 8,
"int64_t: size is not correct");
547 static_assert(
sizeof(uint8_t) == 1,
"uint8_t: size is not correct");
548 static_assert(
sizeof(uint16_t) == 2,
"uint16_t: size is not correct");
549 static_assert(
sizeof(uint32_t) == 4,
"uint32_t: size is not correct");
550 static_assert(
sizeof(uint64_t) == 8,
"uint64_t: size is not correct");
552 static_assert(
sizeof(
LWord) == 4,
"LWord: size is not correct");
553 static_assert(
sizeof(
ULWord) == 4,
"ULWord: size is not correct");
554 static_assert(
sizeof(
PULWord) == 8,
"PULWord: size is not correct");
555 static_assert(
sizeof(
Word) == 2,
"Word: size is not correct");
556 static_assert(
sizeof(
UWord) == 2,
"UWord: size is not correct");
557 static_assert(
sizeof(
UByte) == 1,
"UByte: size is not correct");
558 static_assert(
sizeof(
SByte) == 1,
"SByte: size is not correct");
560 static_assert(
sizeof(
ULWord64) == 8,
"ULWord64: size is not correct");
561 static_assert(
sizeof(
Pointer64) == 8,
"Pointer64: size is not correct");
562 static_assert(
sizeof(
LWord64) == 8,
"LWord64: size is not correct");
563 static_assert(
sizeof(
PVOID) == 8,
"PVOID: size is not correct");
564 static_assert(
sizeof(
Fixed_) == 4,
"Fixed_: size is not correct");
567 #if defined(MSWindows) 568 static_assert(
sizeof(
HANDLE) == 8,
"HANDLE: size is not correct");
569 static_assert(
sizeof(BOOL) == 4,
"BOOL: size is not correct");
570 static_assert(
sizeof(
BOOL_) == 1,
"BOOL_: size is not correct");
571 static_assert(
sizeof(
AJASocket) == 8,
"AJASocket: size is not correct");
572 static_assert(
sizeof(
UWord_) == 2,
"UWord_: size is not correct");
573 static_assert(
sizeof(LPVOID) == 8,
"LPVOID: size is not correct");
574 static_assert(
sizeof(DWORD) == 4,
"DWORD: size is not correct");
575 #elif defined(AJAMac) 576 static_assert(
sizeof(
HANDLE) == 2,
"HANDLE: size is not correct");
578 static_assert(
sizeof(
BOOL_) == 4,
"BOOL_: size is not correct");
579 static_assert(
sizeof(
AJASocket) == 4,
"AJASocket: size is not correct");
580 static_assert(
sizeof(
UWord_) == 4,
"UWord_: size is not correct");
583 #elif defined(AJALinux) 584 static_assert(
sizeof(
HANDLE) == 8,
"HANDLE: size is not correct");
585 static_assert(
sizeof(BOOL) == 1,
"BOOL: size is not correct");
586 static_assert(
sizeof(
BOOL_) == 1,
"BOOL_: size is not correct");
587 static_assert(
sizeof(
AJASocket) == 4,
"AJASocket: size is not correct");
588 static_assert(
sizeof(
UWord_) == 2,
"UWord_: size is not correct");
589 static_assert(
sizeof(LPVOID) == 8,
"LPVOID: size is not correct");
590 static_assert(
sizeof(DWORD) == 4,
"DWORD: size is not correct");
Deprecation control macros.