-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR #11830 from noacoohen:create rsutils-os.cpp, rsutils-os.h
- Loading branch information
Showing
7 changed files
with
73 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,7 +65,5 @@ namespace rs2 | |
|
||
std::string url_encode(const std::string &value); | ||
|
||
std::string get_os_name(); | ||
|
||
bool is_debug(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// License: Apache 2.0. See LICENSE file in root directory. | ||
// Copyright(c) 2023 Intel Corporation. All Rights Reserved. | ||
|
||
#pragma once | ||
#include <string> | ||
|
||
namespace rsutils | ||
{ | ||
namespace os | ||
{ | ||
std::string get_os_name(); | ||
std::string get_platform_name(); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// License: Apache 2.0. See LICENSE file in root directory. | ||
// Copyright(c) 2023 Intel Corporation. All Rights Reserved. | ||
|
||
#include <rsutils/os/os.h> | ||
|
||
namespace rsutils | ||
{ | ||
namespace os | ||
{ | ||
std::string get_os_name() | ||
{ | ||
#ifdef _WIN32 | ||
return "Windows"; | ||
#else | ||
#ifdef __APPLE__ | ||
return "Mac OS"; | ||
#else | ||
#ifdef __linux__ | ||
return "Linux"; | ||
#else | ||
return "Unknown"; | ||
#endif | ||
#endif | ||
#endif | ||
} | ||
|
||
std::string get_platform_name() | ||
{ | ||
#ifdef _WIN64 | ||
return "Windows amd64"; | ||
#elif _WIN32 | ||
return "Windows x86"; | ||
#elif __linux__ | ||
#ifdef __arm__ | ||
return "Linux arm"; | ||
#else | ||
return "Linux amd64"; | ||
#endif | ||
#elif __APPLE__ | ||
return "Mac OS"; | ||
#elif __ANDROID__ | ||
return "Linux arm"; | ||
#else | ||
return ""; | ||
#endif | ||
|
||
} | ||
|
||
} | ||
} | ||
|