mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Don't use <=>. Sigh.
This commit is contained in:
18
lib/flux.h
18
lib/flux.h
@@ -19,12 +19,20 @@ struct Location
|
||||
unsigned head;
|
||||
unsigned groupSize;
|
||||
|
||||
std::strong_ordering operator<=>(const Location& other) const
|
||||
bool operator==(const Location& other) const
|
||||
{
|
||||
if (physicalTrack == other.physicalTrack)
|
||||
return true;
|
||||
return head == other.head;
|
||||
}
|
||||
|
||||
bool operator<(const Location& other) const
|
||||
{
|
||||
auto i = physicalTrack <=> other.physicalTrack;
|
||||
if (i == std::strong_ordering::equal)
|
||||
i = head <=> other.head;
|
||||
return i;
|
||||
if (physicalTrack < other.physicalTrack)
|
||||
return true;
|
||||
if (physicalTrack == other.physicalTrack)
|
||||
return head < other.head;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,20 +1,6 @@
|
||||
#ifndef GLOBALS_H
|
||||
#define GLOBALS_H
|
||||
|
||||
#if defined(_MSVC_LANG)
|
||||
#define CPP_VERSION _MSVC_LANG
|
||||
#else
|
||||
#define CPP_VERSION __cplusplus
|
||||
#endif
|
||||
|
||||
#define CPP20_PRESENT (CPP_VERSION >= 202002L)
|
||||
|
||||
#if defined(__cpp_impl_three_way_comparison) && defined(__cpp_lib_three_way_comparison)
|
||||
#define CPP20_COMPARISONS_PRESENT ((__cpp_impl_three_way_comparison >= 201907L) && (__cpp_lib_three_way_comparison >= 201907L))
|
||||
#else
|
||||
#define CPP20_COMPARISONS_PRESENT CPP20_PRESENT
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <functional>
|
||||
#include <numeric>
|
||||
@@ -30,10 +16,6 @@
|
||||
#include <variant>
|
||||
#include <optional>
|
||||
|
||||
#if CPP20_COMPARISONS_PRESENT
|
||||
#include <compare>
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) || defined(__WIN32__)
|
||||
#include <direct.h>
|
||||
#define mkdir(A, B) _mkdir(A)
|
||||
|
||||
Reference in New Issue
Block a user