[22/25] libebl/libdwelf: define ssize_t and pid_t for MSVC within installed header libdwelf.h and libebl.h

Message ID 20221020182603.815-23-luoyonggang@gmail.com
State Superseded
Headers
Series Patches for building with mingw/gcc msvc/clang-cl |

Commit Message

Yonggang Luo Oct. 20, 2022, 6:26 p.m. UTC
  Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
 libdwelf/libdwelf.h | 5 +++++
 libebl/libebl.h     | 5 +++++
 2 files changed, 10 insertions(+)
  

Patch

diff --git a/libdwelf/libdwelf.h b/libdwelf/libdwelf.h
index 263ca60e..167ac0dc 100644
--- a/libdwelf/libdwelf.h
+++ b/libdwelf/libdwelf.h
@@ -31,6 +31,11 @@ 
 
 #include "libdw.h"
 
+#ifdef _MSC_VER
+#include <BaseTsd.h>
+typedef SSIZE_T ssize_t;
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/libebl/libebl.h b/libebl/libebl.h
index 731001d3..c568f623 100644
--- a/libebl/libebl.h
+++ b/libebl/libebl.h
@@ -44,6 +44,11 @@ 
 
 #include "elf-knowledge.h"
 
+#ifdef _MSC_VER
+#include <BaseTsd.h>
+typedef SSIZE_T ssize_t;
+typedef int pid_t;
+#endif
 
 /* Opaque type for the handle.  libasm.h defined the same thing.  */
 #ifndef _LIBASM_H