]> git.lizzy.rs Git - minetest.git/blobdiff - src/porting.h
Mapgen: Remove '#include treegen.h' from non-mgv6 mapgens
[minetest.git] / src / porting.h
index 5fe81a4409fc0430ee0fe2785669c0d65e49f04e..902547ea9790fb8b4af53892403465dd5016ddc8 100644 (file)
@@ -60,7 +60,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
        #include <unistd.h>
        #include <stdint.h> //for uintptr_t
 
-       #if (defined(linux) || defined(__linux) || defined(__GNU__)) && !defined(_GNU_SOURCE)
+       // Use standard Posix macro for Linux
+       #if (defined(linux) || defined(__linux)) && !defined(__linux__)
+               #define __linux__ 
+       #endif
+       #if (defined(__linux__) || defined(__GNU__)) && !defined(_GNU_SOURCE)
                #define _GNU_SOURCE
        #endif
 
@@ -221,8 +225,8 @@ void initIrrlicht(irr::IrrlichtDevice * );
                host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
                clock_get_time(cclock, &mts);
                mach_port_deallocate(mach_task_self(), cclock);
-               ts.tv_sec = mts.tv_sec;
-               ts.tv_nsec = mts.tv_nsec;
+               ts->tv_sec = mts.tv_sec;
+               ts->tv_nsec = mts.tv_nsec;
 #elif defined(CLOCK_MONOTONIC_RAW)
                clock_gettime(CLOCK_MONOTONIC_RAW, ts);
 #elif defined(_POSIX_MONOTONIC_CLOCK)
@@ -321,7 +325,7 @@ inline const char *getPlatformName()
        return
 #if defined(ANDROID)
        "Android"
-#elif defined(linux) || defined(__linux) || defined(__linux__)
+#elif defined(__linux__)
        "Linux"
 #elif defined(_WIN32) || defined(_WIN64)
        "Windows"
@@ -363,6 +367,11 @@ inline const char *getPlatformName()
 void setXorgClassHint(const video::SExposedVideoData &video_data,
        const std::string &name);
 
+bool setWindowIcon(IrrlichtDevice *device);
+
+bool setXorgWindowIconFromPath(IrrlichtDevice *device,
+       const std::string &icon_file);
+
 // This only needs to be called at the start of execution, since all future
 // threads in the process inherit this exception handler
 void setWin32ExceptionHandler();