mirror of
https://github.com/RubyMetric/chsrc
synced 2025-12-25 11:59:54 +08:00
Feature os_fedora,kali,openbsd,mysys2 and fix some bug with os;Add stdarg in helper.h ;Add OS_macros in helper.h
This commit is contained in:
26
helper.h
26
helper.h
@@ -12,6 +12,7 @@
|
||||
#ifndef XY_H
|
||||
#define XY_H
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
@@ -19,6 +20,7 @@
|
||||
|
||||
// #define NDEBUG
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
static bool xy_on_windows = true;
|
||||
@@ -26,20 +28,36 @@
|
||||
static bool xy_on_macos = false;
|
||||
static bool xy_on_bsds = false;
|
||||
|
||||
static char* xy_os_devnull = "nul";
|
||||
|
||||
#include <windows.h>
|
||||
#define xy_useutf8() SetConsoleOutputCP(65001)
|
||||
|
||||
#else
|
||||
#elif defined(__linux__) || defined(__linux)
|
||||
|
||||
static bool xy_on_windows = false;
|
||||
static bool xy_on_linux = true;
|
||||
static bool xy_on_macos = false;
|
||||
static bool xy_on_bsds = false;
|
||||
|
||||
static char* xy_os_devnull = "/dev/null"
|
||||
#define xy_useutf8()
|
||||
|
||||
#elif defined(TARGET_OS_MAC) ||defined(__MACOSX__)
|
||||
|
||||
static bool xy_on_windows = false;
|
||||
static bool xy_on_linux = false;
|
||||
static bool xy_on_macos = true;
|
||||
static bool xy_on_bsds = false;
|
||||
|
||||
#define xy_useutf8()
|
||||
|
||||
#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
|
||||
|
||||
static bool xy_on_windows = false;
|
||||
static bool xy_on_linux = false;
|
||||
static bool xy_on_macos = false;
|
||||
static bool xy_on_bsds = true;
|
||||
|
||||
#define xy_useutf8()
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user