]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/types.h
lspci: Add support for CXL MLD DVSEC
[pciutils.git] / lib / types.h
index 7011252ed18f865d584262bcc6dbfa710fd0ae05..243997fa7a7da91a11386e1b207c84b0001653e2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     The PCI Library -- Types and Format Strings
  *
- *     Copyright (c) 1997--2017 Martin Mares <mj@ucw.cz>
+ *     Copyright (c) 1997--2022 Martin Mares <mj@ucw.cz>
  *
  *     Can be freely distributed and used under the terms of the GNU GPL.
  */
 #ifndef PCI_HAVE_Uxx_TYPES
 
 #ifdef PCI_OS_WINDOWS
-/* On Windows compilers, use <windef.h> */
-#include <windef.h>
+/* On Windows compilers, use <windows.h> */
+#include <windows.h>
 typedef BYTE u8;
 typedef WORD u16;
 typedef DWORD u32;
 typedef unsigned __int64 u64;
 #define PCI_U64_FMT_X "I64x"
+#define PCI_U64_FMT_U "I64u"
 
 #elif defined(PCI_HAVE_STDINT_H) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
 /* Use standard types in C99 and newer */
@@ -28,6 +29,7 @@ typedef uint16_t u16;
 typedef uint32_t u32;
 typedef uint64_t u64;
 #define PCI_U64_FMT_X PRIx64
+#define PCI_U64_FMT_U PRIu64
 
 #else
 /* Hope for POSIX types from <sys/types.h> */
@@ -40,9 +42,11 @@ typedef u_int32_t u32;
 #if ULONG_MAX > 0xffffffff
 typedef unsigned long u64;
 #define PCI_U64_FMT_X "lx"
+#define PCI_U64_FMT_U "lu"
 #else
 typedef unsigned long long u64;
 #define PCI_U64_FMT_X "llx"
+#define PCI_U64_FMT_U "llu"
 #endif
 
 #endif
@@ -70,6 +74,8 @@ typedef u32 pciaddr_t;
 
 #if defined(__GNUC__) && __GNUC__ > 2
 #define PCI_PRINTF(x,y) __attribute__((format(printf, x, y)))
+#define PCI_NONRET __attribute((noreturn))
 #else
 #define PCI_PRINTF(x,y)
+#define PCI_NONRET
 #endif