Skip to content

Commit

Permalink
Fix enum conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
romainthomas committed Jan 13, 2024
1 parent 6f74de8 commit cea9fc5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions api/python/src/PE/objects/pyBinary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "LIEF/PE/Builder.hpp"
#include "LIEF/PE/Binary.hpp"
#include "LIEF/PE/Relocation.hpp"
#include "LIEF/PE/RelocationEntry.hpp"
#include "LIEF/PE/Section.hpp"
#include "LIEF/PE/ResourceNode.hpp"
#include "LIEF/PE/DataDirectory.hpp"
Expand Down
2 changes: 1 addition & 1 deletion api/python/src/PE/objects/pyRelocationEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void create<RelocationEntry>(nb::module_& m) {
#define ENTRY(X) .value(to_string(RelocationEntry::BASE_TYPES::X), RelocationEntry::BASE_TYPES::X)
enum_<RelocationEntry::BASE_TYPES>(entry, "BASE_TYPES")
ENTRY(UNKNOWN)
ENTRY(ABSOLUTE)
ENTRY(ABS)
ENTRY(HIGH)
ENTRY(LOW)
ENTRY(HIGHLOW)
Expand Down
4 changes: 2 additions & 2 deletions include/LIEF/PE/RelocationEntry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class LIEF_API RelocationEntry : public LIEF::Relocation {
enum class BASE_TYPES {
UNKNOWN = -1,

ABSOLUTE = 0,
ABS = 0,
HIGH = 1,
LOW = 2,
HIGHLOW = 3,
Expand Down Expand Up @@ -126,7 +126,7 @@ class LIEF_API RelocationEntry : public LIEF::Relocation {
RelocationEntry(uint16_t data, Header::MACHINE_TYPES arch);

uint16_t position_ = 0;
BASE_TYPES type_ = BASE_TYPES::ABSOLUTE;
BASE_TYPES type_ = BASE_TYPES::ABS;
Header::MACHINE_TYPES arch_ = Header::MACHINE_TYPES::UNKNOWN;
PE::Relocation* relocation_ = nullptr; // Used to compute some information
};
Expand Down
4 changes: 2 additions & 2 deletions src/PE/RelocationEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ size_t RelocationEntry::size() const {
{
return 64;
}
case BASE_TYPES::ABSOLUTE:
case BASE_TYPES::ABS:
default:
{
return 0;
Expand All @@ -119,7 +119,7 @@ const char* to_string(RelocationEntry::BASE_TYPES type) {
#define ENTRY(X) std::pair(RelocationEntry::BASE_TYPES::X, #X)
STRING_MAP enums2str {
ENTRY(UNKNOWN),
ENTRY(ABSOLUTE),
ENTRY(ABS),
ENTRY(HIGH),
ENTRY(LOW),
ENTRY(HIGHLOW),
Expand Down

0 comments on commit cea9fc5

Please sign in to comment.