summaryrefslogtreecommitdiff
path: root/src/elfxx.h
diff options
context:
space:
mode:
authorStephen Webb <swebb@blackberry.com>2020-06-11 17:56:08 -0400
committerDave Watson <dade.watson@gmail.com>2020-06-18 13:42:19 -0700
commitd4f91519bb0352259aaea484ddce60ad12f1f444 (patch)
tree54540d5f1051981106c1e7c4d4f5a22e5d2086c3 /src/elfxx.h
parent12e70a59df9a2e1c436c79c1dba941ca555db843 (diff)
downloadlibunwind-d4f91519bb0352259aaea484ddce60ad12f1f444.tar.gz
Handle <elf.h> that uses enums instead of defines
Handle the case in which the system-supplied elf.h file uses C enums instead of macros preprocessor defines for some constants. Made the inclusion of the discovered elf.h file more consistent for portability to non-Linux targets. Put some libunwind-specific ELF macros into the UNW_ namespace.
Diffstat (limited to 'src/elfxx.h')
-rw-r--r--src/elfxx.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/elfxx.h b/src/elfxx.h
index 830432c2..fe5fcbcd 100644
--- a/src/elfxx.h
+++ b/src/elfxx.h
@@ -32,7 +32,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include "libunwind_i.h"
-#if ELF_CLASS == ELFCLASS32
+#if UNW_ELF_CLASS == UNW_ELFCLASS32
# define ELF_W(x) ELF32_##x
# define Elf_W(x) Elf32_##x
# define elf_w(x) _Uelf32_##x
@@ -64,7 +64,7 @@ elf_w (valid_object) (struct elf_image *ei)
return 0;
return (memcmp (ei->image, ELFMAG, SELFMAG) == 0
- && ((uint8_t *) ei->image)[EI_CLASS] == ELF_CLASS
+ && ((uint8_t *) ei->image)[EI_CLASS] == UNW_ELF_CLASS
&& ((uint8_t *) ei->image)[EI_VERSION] != EV_NONE
&& ((uint8_t *) ei->image)[EI_VERSION] <= EV_CURRENT);
}