[14/25] libdw: check __OPTIMIZE__ in dwarf_whatattr.c and dwarf_whatform.c to match the header

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

Commit Message

Yonggang Luo Oct. 20, 2022, 6:25 p.m. UTC
  Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
 libdw/dwarf_whatattr.c | 3 ++-
 libdw/dwarf_whatform.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
  

Patch

diff --git a/libdw/dwarf_whatattr.c b/libdw/dwarf_whatattr.c
index d664b021..59769865 100644
--- a/libdw/dwarf_whatattr.c
+++ b/libdw/dwarf_whatattr.c
@@ -34,9 +34,10 @@ 
 #include <dwarf.h>
 #include "libdwP.h"
 
-
+#ifndef __OPTIMIZE__
 unsigned int
 dwarf_whatattr (Dwarf_Attribute *attr)
 {
   return attr == NULL ? 0 : attr->code;
 }
+#endif
diff --git a/libdw/dwarf_whatform.c b/libdw/dwarf_whatform.c
index dee29a9f..01a33424 100644
--- a/libdw/dwarf_whatform.c
+++ b/libdw/dwarf_whatform.c
@@ -34,9 +34,10 @@ 
 #include <dwarf.h>
 #include "libdwP.h"
 
-
+#ifndef __OPTIMIZE__
 unsigned int
 dwarf_whatform (Dwarf_Attribute *attr)
 {
   return attr == NULL ? 0 : attr->form;
 }
+#endif