[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 4/6] contrib/elf2dmp: fix structures definitions
From: |
Viktor Prutyanov |
Subject: |
[Qemu-devel] [PATCH v2 4/6] contrib/elf2dmp: fix structures definitions |
Date: |
Thu, 20 Dec 2018 04:24:39 +0300 |
Remove duplicate structures definitions in case of build for Windows hosts.
Signed-off-by: Viktor Prutyanov <address@hidden>
---
contrib/elf2dmp/kdbg.h | 12 ++++++++----
contrib/elf2dmp/pdb.h | 2 ++
contrib/elf2dmp/pe.h | 6 ++++--
3 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/contrib/elf2dmp/kdbg.h b/contrib/elf2dmp/kdbg.h
index 851b57c321..002e3d0cd5 100644
--- a/contrib/elf2dmp/kdbg.h
+++ b/contrib/elf2dmp/kdbg.h
@@ -25,11 +25,15 @@ typedef struct DBGKD_GET_VERSION64 {
uint64_t DebuggerDataList;
} DBGKD_GET_VERSION64;
+#ifndef _WIN32
+typedef struct LIST_ENTRY64 {
+ struct LIST_ENTRY64 *Flink;
+ struct LIST_ENTRY64 *Blink;
+} LIST_ENTRY64;
+#endif
+
typedef struct DBGKD_DEBUG_DATA_HEADER64 {
- struct LIST_ENTRY64 {
- struct LIST_ENTRY64 *Flink;
- struct LIST_ENTRY64 *Blink;
- } List;
+ LIST_ENTRY64 List;
uint32_t OwnerTag;
uint32_t Size;
} DBGKD_DEBUG_DATA_HEADER64;
diff --git a/contrib/elf2dmp/pdb.h b/contrib/elf2dmp/pdb.h
index 8e395119d1..9a848f75e2 100644
--- a/contrib/elf2dmp/pdb.h
+++ b/contrib/elf2dmp/pdb.h
@@ -11,12 +11,14 @@
#include <stdint.h>
#include <stdlib.h>
+#ifndef _WIN32
typedef struct GUID {
unsigned int Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
+#endif
struct PDB_FILE {
uint32_t size;
diff --git a/contrib/elf2dmp/pe.h b/contrib/elf2dmp/pe.h
index 374e06a9c5..0fd5c23c7f 100644
--- a/contrib/elf2dmp/pe.h
+++ b/contrib/elf2dmp/pe.h
@@ -10,6 +10,7 @@
#include <stdint.h>
+#ifndef _WIN32
typedef struct IMAGE_DOS_HEADER {
uint16_t e_magic; /* 0x00: MZ Header signature */
uint16_t e_cblp; /* 0x02: Bytes on last page of file */
@@ -88,8 +89,6 @@ typedef struct IMAGE_NT_HEADERS64 {
IMAGE_OPTIONAL_HEADER64 OptionalHeader;
} __attribute__ ((packed)) IMAGE_NT_HEADERS64;
-#define IMAGE_FILE_DEBUG_DIRECTORY 6
-
typedef struct IMAGE_DEBUG_DIRECTORY {
uint32_t Characteristics;
uint32_t TimeDateStamp;
@@ -102,6 +101,9 @@ typedef struct IMAGE_DEBUG_DIRECTORY {
} __attribute__ ((packed)) IMAGE_DEBUG_DIRECTORY;
#define IMAGE_DEBUG_TYPE_CODEVIEW 2
+#endif
+
+#define IMAGE_FILE_DEBUG_DIRECTORY 6
typedef struct guid_t {
uint32_t a;
--
2.17.2
- [Qemu-devel] [PATCH v2 0/6] contrib/elf2dmp: elf2dmp for Windows hosts, Viktor Prutyanov, 2018/12/19
- [Qemu-devel] [PATCH v2 6/6] configure: enable elf2dmp build for Windows hosts, Viktor Prutyanov, 2018/12/19
- [Qemu-devel] [PATCH v2 4/6] contrib/elf2dmp: fix structures definitions,
Viktor Prutyanov <=
- [Qemu-devel] [PATCH v2 2/6] contrib/elf2dmp: use GLib in ELF processing, Viktor Prutyanov, 2018/12/19
- [Qemu-devel] [PATCH v2 3/6] contrib/elf2dmp: use GLib in PDB processing, Viktor Prutyanov, 2018/12/19
- [Qemu-devel] [PATCH v2 1/6] contrib/elf2dmp: fix elf.h including, Viktor Prutyanov, 2018/12/19
- [Qemu-devel] [PATCH v2 5/6] contrib/elf2dmp: fix printf format, Viktor Prutyanov, 2018/12/19