Replaced __linux macro with __linux__
This commit is contained in:
parent
7a1574a853
commit
7d751753bc
@ -134,7 +134,7 @@ GCodeSender::set_baud_rate(unsigned int baud_rate)
|
||||
speed_t newSpeed = baud_rate;
|
||||
ioctl(handle, IOSSIOSPEED, &newSpeed);
|
||||
::tcsetattr(handle, TCSANOW, &ios);
|
||||
#elif __linux
|
||||
#elif __linux__
|
||||
termios2 ios;
|
||||
if (ioctl(handle, TCGETS2, &ios))
|
||||
printf("Error in TCGETS2: %s\n", strerror(errno));
|
||||
|
@ -39,9 +39,9 @@
|
||||
|
||||
#include <tbb/task_scheduler_init.h>
|
||||
|
||||
#if defined(__linux) || defined(__GNUC__ )
|
||||
#if defined(__linux__) || defined(__GNUC__ )
|
||||
#include <strings.h>
|
||||
#endif /* __linux */
|
||||
#endif /* __linux__ */
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define strcasecmp _stricmp
|
||||
|
@ -373,7 +373,7 @@ void Preview::reload_print(bool keep_volumes)
|
||||
m_volumes_cleanup_required = !keep_volumes;
|
||||
return;
|
||||
}
|
||||
#endif /* __linux __ */
|
||||
#endif /* __linux__ */
|
||||
if (
|
||||
#ifdef __linux__
|
||||
m_volumes_cleanup_required ||
|
||||
|
@ -257,7 +257,7 @@ bool instance_check(int argc, char** argv, bool app_config_single_instance)
|
||||
hashed_path = std::hash<std::string>{}(boost::filesystem::system_complete(argv[0]).string());
|
||||
#else
|
||||
boost::system::error_code ec;
|
||||
#ifdef __linux
|
||||
#ifdef __linux__
|
||||
// If executed by an AppImage, start the AppImage, not the main process.
|
||||
// see https://docs.appimage.org/packaging-guide/environment-variables.html#id2
|
||||
const char *appimage_env = std::getenv("APPIMAGE");
|
||||
@ -275,7 +275,7 @@ bool instance_check(int argc, char** argv, bool app_config_single_instance)
|
||||
BOOST_LOG_TRIVIAL(error) << "APPIMAGE environment variable was set, but it does not point to a valid file: " << appimage_env;
|
||||
}
|
||||
if (! appimage_env_valid)
|
||||
#endif // __linux
|
||||
#endif // __linux__
|
||||
hashed_path = std::hash<std::string>{}(boost::filesystem::canonical(boost::filesystem::system_complete(argv[0]), ec).string());
|
||||
if (ec.value() > 0) { // canonical was not able to find the executable (can happen with appimage on some systems. Does it fail on Fuse file systems?)
|
||||
ec.clear();
|
||||
|
@ -93,7 +93,7 @@ static void start_new_slicer_or_gcodeviewer(const NewSlicerInstanceType instance
|
||||
{
|
||||
std::vector<const char*> args;
|
||||
args.reserve(3);
|
||||
#ifdef __linux
|
||||
#ifdef __linux__
|
||||
static const char* gcodeviewer_param = "--gcodeviewer";
|
||||
{
|
||||
// If executed by an AppImage, start the AppImage, not the main process.
|
||||
@ -105,7 +105,7 @@ static void start_new_slicer_or_gcodeviewer(const NewSlicerInstanceType instance
|
||||
args.emplace_back(gcodeviewer_param);
|
||||
}
|
||||
}
|
||||
#endif // __linux
|
||||
#endif // __linux__
|
||||
std::string my_path;
|
||||
if (args.empty()) {
|
||||
// Binary path was not set to the AppImage in the Linux specific block above, call the application directly.
|
||||
|
@ -313,7 +313,7 @@ void Serial::set_baud_rate(unsigned baud_rate)
|
||||
speed_t newSpeed = baud_rate;
|
||||
handle_errno(::ioctl(handle, IOSSIOSPEED, &newSpeed));
|
||||
handle_errno(::tcsetattr(handle, TCSANOW, &ios));
|
||||
#elif __linux
|
||||
#elif __linux__
|
||||
|
||||
/* The following definitions are kindly borrowed from:
|
||||
/usr/include/asm-generic/termbits.h
|
||||
|
Loading…
Reference in New Issue
Block a user