summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2015-01-22 12:25:18 -0800
committerBen Longbons <b.r.longbons@gmail.com>2015-01-22 12:25:18 -0800
commitb2f0d495cd85188e0f9f2d4d363655da40e6e5e6 (patch)
treeccc8997361bd66efeea6e7e1502e1b483f04ed7f
parent57e5142d5c9d326912610e3bd60743420f8a328a (diff)
downloadtmwa-b2f0d495cd85188e0f9f2d4d363655da40e6e5e6.tar.gz
tmwa-b2f0d495cd85188e0f9f2d4d363655da40e6e5e6.tar.bz2
tmwa-b2f0d495cd85188e0f9f2d4d363655da40e6e5e6.tar.xz
tmwa-b2f0d495cd85188e0f9f2d4d363655da40e6e5e6.zip
Have I mentioned that I hate ADL?
-rw-r--r--src/char/char.cpp6
-rw-r--r--src/char/int_party.cpp2
-rw-r--r--src/char/int_storage.cpp2
-rw-r--r--src/char/inter.cpp2
-rw-r--r--src/high/extract_mmo.cpp10
-rw-r--r--src/high/extract_mmo.hpp10
-rw-r--r--src/io/extract.cpp20
-rw-r--r--src/io/extract.hpp54
-rw-r--r--src/login/login.cpp2
-rw-r--r--src/map/mapflag.cpp2
-rw-r--r--src/map/mapflag.hpp2
-rw-r--r--src/map/mob.cpp8
-rw-r--r--src/map/script-fun.cpp1
-rw-r--r--src/mmo/config_parse.cpp1
-rw-r--r--src/mmo/extract_enums.cpp2
-rw-r--r--src/mmo/extract_enums.hpp24
-rw-r--r--src/mmo/human_time_diff.cpp2
-rw-r--r--src/mmo/human_time_diff.hpp2
-rw-r--r--src/mmo/human_time_diff_test.cpp2
-rw-r--r--src/mmo/ids.cpp4
-rw-r--r--src/mmo/ids.hpp6
-rw-r--r--src/mmo/version.cpp2
-rw-r--r--src/mmo/version.hpp2
-rw-r--r--src/net/ip.cpp4
-rw-r--r--src/net/ip.hpp4
-rw-r--r--src/net/ip_test.cpp1
26 files changed, 92 insertions, 85 deletions
diff --git a/src/char/char.cpp b/src/char/char.cpp
index 57788ee..0bee093 100644
--- a/src/char/char.cpp
+++ b/src/char/char.cpp
@@ -409,7 +409,7 @@ AString mmo_char_tostr(struct CharPair *cp)
}
static
-bool extract(XString str, Point *p)
+bool impl_extract(XString str, Point *p)
{
return extract(str, record<','>(&p->map_, &p->x, &p->y));
}
@@ -422,7 +422,7 @@ struct skill_loader
};
static
-bool extract(XString str, struct skill_loader *s)
+bool impl_extract(XString str, struct skill_loader *s)
{
uint32_t flags_and_level;
if (!extract(str,
@@ -437,7 +437,7 @@ bool extract(XString str, struct skill_loader *s)
// Function to set the character from the line (at read of characters file)
//-------------------------------------------------------------------------
static
-bool extract(XString str, CharPair *cp)
+bool impl_extract(XString str, CharPair *cp)
{
CharKey *k = &cp->key;
CharData *p = cp->data.get();
diff --git a/src/char/int_party.cpp b/src/char/int_party.cpp
index 731669a..a16bc20 100644
--- a/src/char/int_party.cpp
+++ b/src/char/int_party.cpp
@@ -93,7 +93,7 @@ AString inter_party_tostr(PartyPair p)
}
static
-bool extract(XString str, PartyPair *pp)
+bool impl_extract(XString str, PartyPair *pp)
{
PartyPair& p = *pp;
diff --git a/src/char/int_storage.cpp b/src/char/int_storage.cpp
index c02f037..0c76678 100644
--- a/src/char/int_storage.cpp
+++ b/src/char/int_storage.cpp
@@ -95,7 +95,7 @@ AString storage_tostr(Storage *p)
// 文字列を倉庫データに変換
static
-bool extract(XString str, Storage *p)
+bool impl_extract(XString str, Storage *p)
{
std::vector<Item> storage_items;
if (!extract(str,
diff --git a/src/char/inter.cpp b/src/char/inter.cpp
index c081825..4b10dbc 100644
--- a/src/char/inter.cpp
+++ b/src/char/inter.cpp
@@ -85,7 +85,7 @@ AString inter_accreg_tostr(struct accreg *reg)
// アカウント変数を文字列から変換
static
-bool extract(XString str, struct accreg *reg)
+bool impl_extract(XString str, struct accreg *reg)
{
std::vector<GlobalReg> vars;
if (!extract(str,
diff --git a/src/high/extract_mmo.cpp b/src/high/extract_mmo.cpp
index a674656..dae6a3b 100644
--- a/src/high/extract_mmo.cpp
+++ b/src/high/extract_mmo.cpp
@@ -32,13 +32,13 @@
// TODO also pass an io::LineSpan around.
namespace tmwa
{
-bool extract(XString str, GlobalReg *var)
+bool impl_extract(XString str, GlobalReg *var)
{
return extract(str,
record<','>(&var->str, &var->value));
}
-bool extract(XString str, Item *it)
+bool impl_extract(XString str, Item *it)
{
XString ignored;
XString corruption_hack_amount;
@@ -66,7 +66,7 @@ bool extract(XString str, Item *it)
return rv;
}
-bool extract(XString str, MapName *m)
+bool impl_extract(XString str, MapName *m)
{
XString::iterator it = std::find(str.begin(), str.end(), '.');
str = str.xislice_h(it);
@@ -76,7 +76,7 @@ bool extract(XString str, MapName *m)
return rv;
}
-bool extract(XString str, CharName *out)
+bool impl_extract(XString str, CharName *out)
{
VString<23> tmp;
if (extract(str, &tmp))
@@ -87,7 +87,7 @@ bool extract(XString str, CharName *out)
return false;
}
-bool extract(XString str, NpcEvent *ev)
+bool impl_extract(XString str, NpcEvent *ev)
{
XString mid;
return extract(str, record<':'>(&ev->npc, &mid, &ev->label)) && !mid;
diff --git a/src/high/extract_mmo.hpp b/src/high/extract_mmo.hpp
index 0c18090..5fcd06f 100644
--- a/src/high/extract_mmo.hpp
+++ b/src/high/extract_mmo.hpp
@@ -23,10 +23,10 @@
namespace tmwa
{
-bool extract(XString str, GlobalReg *var);
-bool extract(XString str, Item *it);
-bool extract(XString str, MapName *m);
-bool extract(XString str, CharName *out);
+bool impl_extract(XString str, GlobalReg *var);
+bool impl_extract(XString str, Item *it);
+bool impl_extract(XString str, MapName *m);
+bool impl_extract(XString str, CharName *out);
-bool extract(XString str, NpcEvent *ev);
+bool impl_extract(XString str, NpcEvent *ev);
} // namespace tmwa
diff --git a/src/io/extract.cpp b/src/io/extract.cpp
index 55d3980..fce4dab 100644
--- a/src/io/extract.cpp
+++ b/src/io/extract.cpp
@@ -30,25 +30,25 @@
// TODO also pass an io::LineSpan around.
namespace tmwa
{
-bool extract(XString str, XString *rv)
+bool impl_extract(XString str, XString *rv)
{
*rv = str;
return true;
}
-bool extract(XString str, RString *rv)
+bool impl_extract(XString str, RString *rv)
{
*rv = str;
return true;
}
-bool extract(XString str, AString *rv)
+bool impl_extract(XString str, AString *rv)
{
*rv = str;
return true;
}
-bool extract(XString str, std::chrono::nanoseconds *ns)
+bool impl_extract(XString str, std::chrono::nanoseconds *ns)
{
std::chrono::nanoseconds::rep rep;
if (extract(str, &rep))
@@ -73,7 +73,7 @@ bool extract(XString str, std::chrono::nanoseconds *ns)
}
return false;
}
-bool extract(XString str, std::chrono::microseconds *us)
+bool impl_extract(XString str, std::chrono::microseconds *us)
{
std::chrono::microseconds::rep rep;
if (extract(str, &rep))
@@ -98,7 +98,7 @@ bool extract(XString str, std::chrono::microseconds *us)
}
return false;
}
-bool extract(XString str, std::chrono::milliseconds *ms)
+bool impl_extract(XString str, std::chrono::milliseconds *ms)
{
std::chrono::milliseconds::rep rep;
if (extract(str, &rep))
@@ -123,7 +123,7 @@ bool extract(XString str, std::chrono::milliseconds *ms)
}
return false;
}
-bool extract(XString str, std::chrono::seconds *s)
+bool impl_extract(XString str, std::chrono::seconds *s)
{
std::chrono::seconds::rep rep;
if (extract(str, &rep))
@@ -148,7 +148,7 @@ bool extract(XString str, std::chrono::seconds *s)
}
return false;
}
-bool extract(XString str, std::chrono::minutes *min)
+bool impl_extract(XString str, std::chrono::minutes *min)
{
std::chrono::minutes::rep rep;
if (extract(str, &rep))
@@ -173,7 +173,7 @@ bool extract(XString str, std::chrono::minutes *min)
}
return false;
}
-bool extract(XString str, std::chrono::hours *h)
+bool impl_extract(XString str, std::chrono::hours *h)
{
std::chrono::hours::rep rep;
if (extract(str, &rep))
@@ -198,7 +198,7 @@ bool extract(XString str, std::chrono::hours *h)
}
return false;
}
-bool extract(XString str, std::chrono::duration<int, std::ratio<60*60*24>> *d)
+bool impl_extract(XString str, std::chrono::duration<int, std::ratio<60*60*24>> *d)
{
std::chrono::duration<int, std::ratio<60*60*24>>::rep rep;
if (extract(str, &rep))
diff --git a/src/io/extract.hpp b/src/io/extract.hpp
index 174243e..897f50e 100644
--- a/src/io/extract.hpp
+++ b/src/io/extract.hpp
@@ -39,10 +39,10 @@
namespace tmwa
{
template<class T>
-bool do_extract(XString str, T t);
+bool extract(XString str, T t);
template<class T, typename=typename std::enable_if<std::is_integral<T>::value && !std::is_same<T, char>::value && !std::is_same<T, bool>::value>::type>
-bool extract(XString str, T *iv)
+bool impl_extract(XString str, T *iv)
{
if (!str || str.size() > 20)
return false;
@@ -75,7 +75,7 @@ bool extract(XString str, T *iv)
}
inline
-bool extract(XString str, TimeT *tv)
+bool impl_extract(XString str, TimeT *tv)
{
return extract(str, &tv->value);
}
@@ -93,12 +93,12 @@ bool extract_as_int(XString str, T *iv)
return true;
}
-bool extract(XString str, XString *rv);
-bool extract(XString str, RString *rv);
-bool extract(XString str, AString *rv);
+bool impl_extract(XString str, XString *rv);
+bool impl_extract(XString str, RString *rv);
+bool impl_extract(XString str, AString *rv);
template<uint8_t N>
-bool extract(XString str, VString<N> *out)
+bool impl_extract(XString str, VString<N> *out)
{
if (str.size() > N)
return false;
@@ -107,7 +107,7 @@ bool extract(XString str, VString<N> *out)
}
inline
-bool extract(XString str, LString exact)
+bool impl_extract(XString str, LString exact)
{
return str == exact;
}
@@ -126,7 +126,7 @@ LStripper<T> lstripping(T v)
}
template<class T>
-bool extract(XString str, LStripper<T> out)
+bool impl_extract(XString str, LStripper<T> out)
{
return extract(str.lstrip(), out.impl);
}
@@ -163,13 +163,13 @@ Record<split, n, T...> record(T... t)
}
template<char split, int n>
-bool extract(XString str, Record<split, n>)
+bool impl_extract(XString str, Record<split, n>)
{
return !str;
}
template<char split, int n, class F, class... R>
-bool extract(XString str, Record<split, n, F, R...> rec)
+bool impl_extract(XString str, Record<split, n, F, R...> rec)
{
XString::iterator s = std::find(str.begin(), str.end(), split);
XString::iterator s2 = s;
@@ -198,7 +198,7 @@ VRecord<split, T> vrec(std::vector<T> *arr)
}
template<char split, class T>
-bool extract(XString str, VRecord<split, T> rec)
+bool impl_extract(XString str, VRecord<split, T> rec)
{
if (!str)
return true;
@@ -210,23 +210,25 @@ bool extract(XString str, VRecord<split, T> rec)
&& extract(str.xislice_t(s + 1), rec);
}
-template<class T>
-bool do_extract(XString str, T t)
-{
- return extract(str, t);
-}
-
template<class R>
-bool extract(XString str, Wrapped<R> *w)
+bool impl_extract(XString str, Wrapped<R> *w)
{
return extract(str, &w->_value);
}
-bool extract(XString str, std::chrono::nanoseconds *ns);
-bool extract(XString str, std::chrono::microseconds *us);
-bool extract(XString str, std::chrono::milliseconds *ms);
-bool extract(XString str, std::chrono::seconds *s);
-bool extract(XString str, std::chrono::minutes *min);
-bool extract(XString str, std::chrono::hours *h);
-bool extract(XString str, std::chrono::duration<int, std::ratio<60*60*24>> *d);
+bool impl_extract(XString str, std::chrono::nanoseconds *ns);
+bool impl_extract(XString str, std::chrono::microseconds *us);
+bool impl_extract(XString str, std::chrono::milliseconds *ms);
+bool impl_extract(XString str, std::chrono::seconds *s);
+bool impl_extract(XString str, std::chrono::minutes *min);
+bool impl_extract(XString str, std::chrono::hours *h);
+bool impl_extract(XString str, std::chrono::duration<int, std::ratio<60*60*24>> *d);
+
+// this must come after all non-`namespace tmwa` `impl_extract`s.
+// In particular, the ones for `*int*` and `std::chrono::*`
+template<class T>
+bool extract(XString str, T t)
+{
+ return impl_extract(str, t);
+}
} // namespace tmwa
diff --git a/src/login/login.cpp b/src/login/login.cpp
index d58de14..fb90cbe 100644
--- a/src/login/login.cpp
+++ b/src/login/login.cpp
@@ -479,7 +479,7 @@ AString mmo_auth_tostr(const AuthData *p)
}
static
-bool extract(XString line, AuthData *ad)
+bool impl_extract(XString line, AuthData *ad)
{
TimeT unused_connect_until_time;
std::vector<GlobalReg> vars;
diff --git a/src/map/mapflag.cpp b/src/map/mapflag.cpp
index 91dfe8d..d5e78d8 100644
--- a/src/map/mapflag.cpp
+++ b/src/map/mapflag.cpp
@@ -40,7 +40,7 @@ void MapFlags::set(MapFlag mf, bool val)
flags &=~ static_cast<unsigned>(mf);
}
-bool extract(XString str, MapFlag *mf)
+bool impl_extract(XString str, MapFlag *mf)
{
const struct
{
diff --git a/src/map/mapflag.hpp b/src/map/mapflag.hpp
index d964405..5818697 100644
--- a/src/map/mapflag.hpp
+++ b/src/map/mapflag.hpp
@@ -75,7 +75,7 @@ public:
void set(MapFlag, bool);
};
-bool extract(XString str, MapFlag *mf);
+bool impl_extract(XString str, MapFlag *mf);
MapFlag map_flag_from_int(int shift);
} // namespace tmwa
diff --git a/src/map/mob.cpp b/src/map/mob.cpp
index b01a4ff..c690ad0 100644
--- a/src/map/mob.cpp
+++ b/src/map/mob.cpp
@@ -3428,7 +3428,7 @@ int mob_makedummymobdb(Species mob_class)
}
static
-bool extract(XString str, LevelElement *le)
+bool impl_extract(XString str, LevelElement *le)
{
int tmp;
if (extract(str, &tmp))
@@ -3583,7 +3583,7 @@ bool mob_readdb(ZString filename)
}
static
-bool extract(XString str, MobSkillCondition *msc)
+bool impl_extract(XString str, MobSkillCondition *msc)
{
const struct
{
@@ -3607,7 +3607,7 @@ bool extract(XString str, MobSkillCondition *msc)
}
static
-bool extract(XString str, MobSkillState *mss)
+bool impl_extract(XString str, MobSkillState *mss)
{
const struct
{
@@ -3630,7 +3630,7 @@ bool extract(XString str, MobSkillState *mss)
}
static
-bool extract(XString str, MobSkillTarget *mst)
+bool impl_extract(XString str, MobSkillTarget *mst)
{
const struct
{
diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp
index cc28cd2..12f8679 100644
--- a/src/map/script-fun.cpp
+++ b/src/map/script-fun.cpp
@@ -30,6 +30,7 @@
#include "../generic/random.hpp"
#include "../io/cxxstdio.hpp"
+#include "../io/extract.hpp"
#include "../net/timer.hpp"
diff --git a/src/mmo/config_parse.cpp b/src/mmo/config_parse.cpp
index 8362810..b47ee79 100644
--- a/src/mmo/config_parse.cpp
+++ b/src/mmo/config_parse.cpp
@@ -24,6 +24,7 @@
#include "../strings/zstring.hpp"
#include "../io/cxxstdio.hpp"
+#include "../io/extract.hpp"
#include "../io/line.hpp"
#include "version.hpp"
diff --git a/src/mmo/extract_enums.cpp b/src/mmo/extract_enums.cpp
index ecf6940..efafa39 100644
--- a/src/mmo/extract_enums.cpp
+++ b/src/mmo/extract_enums.cpp
@@ -23,7 +23,7 @@
namespace tmwa
{
-bool extract(XString str, DIR *d)
+bool impl_extract(XString str, DIR *d)
{
unsigned di;
if (extract(str, &di) && di < 8)
diff --git a/src/mmo/extract_enums.hpp b/src/mmo/extract_enums.hpp
index 96e5df7..1aab17e 100644
--- a/src/mmo/extract_enums.hpp
+++ b/src/mmo/extract_enums.hpp
@@ -38,15 +38,15 @@ enum class Opt2 : uint16_t;
enum class Opt0 : uint16_t;
inline
-bool extract(XString str, EPOS *iv) { return extract_as_int(str, iv); }
+bool impl_extract(XString str, EPOS *iv) { return extract_as_int(str, iv); }
inline
-bool extract(XString str, MobMode *iv) { return extract_as_int(str, iv); }
+bool impl_extract(XString str, MobMode *iv) { return extract_as_int(str, iv); }
inline
-bool extract(XString str, Opt1 *iv) { return extract_as_int(str, iv); }
+bool impl_extract(XString str, Opt1 *iv) { return extract_as_int(str, iv); }
inline
-bool extract(XString str, Opt2 *iv) { return extract_as_int(str, iv); }
+bool impl_extract(XString str, Opt2 *iv) { return extract_as_int(str, iv); }
inline
-bool extract(XString str, Opt0 *iv) { return extract_as_int(str, iv); }
+bool impl_extract(XString str, Opt0 *iv) { return extract_as_int(str, iv); }
}
enum class ItemLook : uint16_t;
@@ -57,17 +57,17 @@ enum class SkillID : uint16_t;
enum class StatusChange : uint16_t;
inline
-bool extract(XString str, ItemLook *iv) { return extract_as_int(str, iv); }
+bool impl_extract(XString str, ItemLook *iv) { return extract_as_int(str, iv); }
inline
-bool extract(XString str, ItemType *iv) { return extract_as_int(str, iv); }
+bool impl_extract(XString str, ItemType *iv) { return extract_as_int(str, iv); }
inline
-bool extract(XString str, Race *iv) { return extract_as_int(str, iv); }
+bool impl_extract(XString str, Race *iv) { return extract_as_int(str, iv); }
inline
-bool extract(XString str, SEX *iv) { return extract_as_int(str, iv); }
+bool impl_extract(XString str, SEX *iv) { return extract_as_int(str, iv); }
inline
-bool extract(XString str, SkillID *iv) { return extract_as_int(str, iv); }
+bool impl_extract(XString str, SkillID *iv) { return extract_as_int(str, iv); }
inline
-bool extract(XString str, StatusChange *iv) { return extract_as_int(str, iv); }
+bool impl_extract(XString str, StatusChange *iv) { return extract_as_int(str, iv); }
-bool extract(XString, DIR *);
+bool impl_extract(XString, DIR *);
} // namespace tmwa
diff --git a/src/mmo/human_time_diff.cpp b/src/mmo/human_time_diff.cpp
index e434773..aaa7928 100644
--- a/src/mmo/human_time_diff.cpp
+++ b/src/mmo/human_time_diff.cpp
@@ -25,7 +25,7 @@
namespace tmwa
{
-bool extract(XString str, HumanTimeDiff *iv)
+bool impl_extract(XString str, HumanTimeDiff *iv)
{
// str is a sequence of [-+]?[0-9]+([ay]|m|[jd]|h|mn|s)
// there are NO spaces here
diff --git a/src/mmo/human_time_diff.hpp b/src/mmo/human_time_diff.hpp
index 40352d0..92b3288 100644
--- a/src/mmo/human_time_diff.hpp
+++ b/src/mmo/human_time_diff.hpp
@@ -42,5 +42,5 @@ struct HumanTimeDiff
return !bool(*this);
}
};
-bool extract(XString str, HumanTimeDiff *iv);
+bool impl_extract(XString str, HumanTimeDiff *iv);
} // namespace tmwa
diff --git a/src/mmo/human_time_diff_test.cpp b/src/mmo/human_time_diff_test.cpp
index c18599d..08a75bf 100644
--- a/src/mmo/human_time_diff_test.cpp
+++ b/src/mmo/human_time_diff_test.cpp
@@ -20,6 +20,8 @@
#include <gtest/gtest.h>
+#include "../io/extract.hpp"
+
#include "../poison.hpp"
diff --git a/src/mmo/ids.cpp b/src/mmo/ids.cpp
index 9c013ba..65c470b 100644
--- a/src/mmo/ids.cpp
+++ b/src/mmo/ids.cpp
@@ -25,7 +25,7 @@
namespace tmwa
{
-bool extract(XString str, Species *w)
+bool impl_extract(XString str, Species *w)
{
// lots of data files use this
if (str == "-1"_s)
@@ -35,7 +35,7 @@ bool extract(XString str, Species *w)
}
return extract(str, &w->_value);
}
-bool extract(XString str, GmLevel *lvl)
+bool impl_extract(XString str, GmLevel *lvl)
{
return extract(str, &lvl->bits);
}
diff --git a/src/mmo/ids.hpp b/src/mmo/ids.hpp
index 389f9e9..c1482ef 100644
--- a/src/mmo/ids.hpp
+++ b/src/mmo/ids.hpp
@@ -30,7 +30,7 @@ class Species : public Wrapped<uint16_t> { public: explicit operator bool() cons
constexpr Species NEGATIVE_SPECIES = Species();
-bool extract(XString str, Species *w);
+bool impl_extract(XString str, Species *w);
class AccountId : public Wrapped<uint32_t> { public: constexpr AccountId() : Wrapped<uint32_t>() {} protected: constexpr explicit AccountId(uint32_t a) : Wrapped<uint32_t>(a) {} };
@@ -41,12 +41,12 @@ class ItemNameId : public Wrapped<uint16_t> { public: constexpr ItemNameId() : W
class BlockId : public Wrapped<uint32_t> { public: constexpr BlockId() : Wrapped<uint32_t>() {} protected: constexpr explicit BlockId(uint32_t a) : Wrapped<uint32_t>(a) {} };
-bool extract(XString str, GmLevel *lvl);
+bool impl_extract(XString str, GmLevel *lvl);
class GmLevel
{
uint32_t bits;
- friend bool extract(XString str, GmLevel *lvl);
+ friend bool impl_extract(XString str, GmLevel *lvl);
constexpr explicit
GmLevel(uint32_t b) : bits(b) {}
constexpr explicit
diff --git a/src/mmo/version.cpp b/src/mmo/version.cpp
index aec4e73..93ea794 100644
--- a/src/mmo/version.cpp
+++ b/src/mmo/version.cpp
@@ -66,7 +66,7 @@ Version CURRENT_MAP_SERVER_VERSION =
LString CURRENT_VERSION_STRING = VERSION_STRING;
-bool extract(XString str, Version *vers)
+bool impl_extract(XString str, Version *vers)
{
*vers = {};
// TODO should I try to extract dev and vend also?
diff --git a/src/mmo/version.hpp b/src/mmo/version.hpp
index 1eed223..a09953f 100644
--- a/src/mmo/version.hpp
+++ b/src/mmo/version.hpp
@@ -87,7 +87,7 @@ extern Version CURRENT_MAP_SERVER_VERSION;
extern LString CURRENT_VERSION_STRING;
-bool extract(XString str, Version *vers);
+bool impl_extract(XString str, Version *vers);
extern LString VERSION_INFO_HEADER;
extern LString VERSION_INFO_COMMIT;
diff --git a/src/net/ip.cpp b/src/net/ip.cpp
index 4ec022b..3dc242d 100644
--- a/src/net/ip.cpp
+++ b/src/net/ip.cpp
@@ -29,7 +29,7 @@
namespace tmwa
{
-bool extract(XString str, IP4Address *rv)
+bool impl_extract(XString str, IP4Address *rv)
{
if (str.endswith('.'))
return false;
@@ -42,7 +42,7 @@ bool extract(XString str, IP4Address *rv)
return false;
}
-bool extract(XString str, IP4Mask *rv)
+bool impl_extract(XString str, IP4Mask *rv)
{
IP4Address a, m;
unsigned b;
diff --git a/src/net/ip.hpp b/src/net/ip.hpp
index ab45c56..82d9430 100644
--- a/src/net/ip.hpp
+++ b/src/net/ip.hpp
@@ -158,7 +158,7 @@ IP4Address IP4_BROADCAST({255, 255, 255, 255});
VString<15> convert_for_printf(IP4Address a);
VString<31> convert_for_printf(IP4Mask m);
-bool extract(XString str, IP4Address *iv);
+bool impl_extract(XString str, IP4Address *iv);
-bool extract(XString str, IP4Mask *iv);
+bool impl_extract(XString str, IP4Mask *iv);
} // namespace tmwa
diff --git a/src/net/ip_test.cpp b/src/net/ip_test.cpp
index 419dc03..2b9bcad 100644
--- a/src/net/ip_test.cpp
+++ b/src/net/ip_test.cpp
@@ -24,6 +24,7 @@
#include "../strings/literal.hpp"
#include "../io/cxxstdio.hpp"
+#include "../io/extract.hpp"
#include "../poison.hpp"