Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable unavailable functionality on xbox #887

Merged
merged 2 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions alc/alconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ const char *GetConfigValue(const char *devName, const char *blockName, const cha
#ifdef _WIN32
void ReadALConfig()
{
#if !defined(_GAMING_XBOX)
{
#if !defined(ALSOFT_UWP)
WCHAR buffer[MAX_PATH];
Expand All @@ -345,6 +346,7 @@ void ReadALConfig()
if(f.is_open())
LoadConfigFromFile(f);
}
#endif


std::string ppath{GetProcBinary().path};
Expand Down
4 changes: 4 additions & 0 deletions common/strutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ namespace al {

std::optional<std::string> getenv(const char *envname)
{
#ifdef _GAMING_XBOX
const char *str{::getenv(envname)};
#else
const char *str{std::getenv(envname)};
#endif
Comment on lines +48 to +52
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For unknown reason std::getenv is not available for non desktop apps:

#ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
using _CSTD getenv;
using _CSTD system;
#endif // _CRT_USE_WINAPI_FAMILY_DESKTOP_APP

however getenv is available

if(str && str[0] != '\0')
return str;
return std::nullopt;
Expand Down
2 changes: 1 addition & 1 deletion core/helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ std::vector<std::string> SearchDataFiles(const char *ext, const char *subdir)
std::replace(path.begin(), path.end(), '/', '\\');
DirectorySearch(path.c_str(), ext, &results);

#if !defined(ALSOFT_UWP)
#if !defined(ALSOFT_UWP) && !defined(_GAMING_XBOX)
/* Search the local and global data dirs. */
for(auto id : std::array{CSIDL_APPDATA, CSIDL_COMMON_APPDATA})
{
Expand Down