diff options
author | Roderick W. Smith <rodsmith@rodsbooks.com> | 2014-03-28 23:54:21 -0400 |
---|---|---|
committer | Roderick W. Smith <rodsmith@rodsbooks.com> | 2014-03-28 23:54:21 -0400 |
commit | 1f7822eb54337766002431f01e5934c7d4703628 (patch) | |
tree | 7008707bbc852136bfc5c879cfde1078ebd52f5d /gpt.cc | |
parent | 1a65132980bfef8f9c898afbefcda00277b5ee48 (diff) | |
download | sgdisk-1f7822eb54337766002431f01e5934c7d4703628.tar.gz |
Changes to support compilation with UEFI GPT fdisk library.
Diffstat (limited to 'gpt.cc')
-rw-r--r-- | gpt.cc | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -38,6 +38,23 @@ using namespace std; #define log2(x) (log((double) x) / log(2.0)) #endif // Microsoft Visual C++ +#ifdef EFI +// in UEFI mode MMX registers are not yet available so using the +// x86_64 ABI to move "double" values around is not an option. +#ifdef log2 +#undef log2 +#endif +#define log2(x) log2_32( x ) +static inline uint32_t log2_32(uint32_t v) { + int r = -1; + while (v >= 1) { + r++; + v >>= 1; + } + return r; +} +#endif + /**************************************** * * * GPTData class and related structures * |