based/include/based/env/envb.h
Max d49e725846 refactor(shared): Library order changed
Changed library linking order: cli (executable) <= runtime(static) <= based (shared)
2023-12-03 16:04:09 +01:00

94 lines
1.8 KiB
C
Executable File

/**
* @file envb.h
* @brief Environment base header.
* @version 0.1
* @date 2023-01-11
*/
#ifndef ENVB_H
#define ENVB_H
// ========================================
// Linux
// ========================================
#ifdef __gnu_linux__
#define OS_LINUX
#define EXPORT __attribute__((visibility("default")))
#define CDECL_ATT __attribute__((cdecl))
#define NO_RETURN_ATT __attribute__((noreturn))
#ifdef __x86_64__
#if defined(__i386__) || defined(_M_IX86)
#define OS_ENV 32
#else // defined(__i386__) || defined(_M_IX86)
#define OS_ENV 64
#endif // defined(__i386__) || defined(_M_IX86)
#endif // __x86_64__
#endif // __gnu_linux__
// ========================================
// Windows
// ========================================
#ifdef _WIN32
#define OS_WINDOWS 1
#define EXPORT __declspec(dllexport)
#ifdef _WIN64 // _WIN64
#define OS_ENV 64
#else // x32
#define OS_ENV 32
#endif // _WIN64
#endif // _WIN32
// ===================================================================
//
// Lib types
//
// ===================================================================
typedef unsigned char uint8;
typedef short int16;
typedef unsigned short uint16;
typedef int int32;
typedef unsigned int uint32;
typedef long long int64;
typedef unsigned long long uint64;
#if OS_ENV == 64
typedef uint64 uintptr;
#else
typedef uint32 uintptr;
#endif
/**
* @brief Typedef for process identifier.
*/
typedef int32 p_id;
/**
* @brief Typedef for wide char.
*/
typedef uint16 w_char;
/**
* @brief Typedef for byte.
*/
typedef uint8 BYTE;
/**
* @brief Typedef for bit field.
*/
typedef uint32 bit_field;
/**
* @brief Typedef for offset.
*/
typedef long int off_set;
/**
* @brief Typedef for usize.
*/
typedef long unsigned int usize;
/**
* @brief Typedef for ssize.
*/
typedef long signed int ssize;
#endif //ENVB_H