Skip to content

Commit b7e4b11

Browse files
authored
Merge pull request #25 from extrowerk/master
Haiku support
2 parents 16c51cf + 6e3c451 commit b7e4b11

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

libs/common/src/LocaleHelper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ std::locale createUtf8Locale()
7272
// On windows we want to enforce the encoding (mostly UTF8) so use boost to generate it
7373
return boost::locale::generator().generate("");
7474
}
75-
#elif BOOST_OS_MACOS
75+
#elif BOOST_OS_MACOS || BOOST_OS_HAIKU
7676
std::locale createUtf8Locale()
7777
{
78-
// Don't change the locale on OSX. Using "" fails with 'locale::facet::_S_create_c_locale name not valid'
78+
// Don't change the locale on OSX or HAIKU. Using "" fails with 'locale::facet::_S_create_c_locale name not valid'
7979
return LocaleHelper::getBfsDefaultLocale();
8080
}
8181
#else

libs/common/src/getExecutablePath.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,22 @@ std::string getExecutablePath()
121121
return ec ? "" : p.make_preferred().string();
122122
}
123123

124+
#elif(BOOST_OS_HAIKU)
125+
std::string getExecutablePath()
126+
{
127+
std::string ret;
128+
int32 cookie = 0;
129+
image_info info;
130+
while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK)
131+
{
132+
if (info.type == B_APP_IMAGE)
133+
{
134+
ret = info.name;
135+
}
136+
}
137+
return ret;
138+
}
139+
124140
#else
125141

126142
# error Unsupported plattform!

0 commit comments

Comments
 (0)