Wheefun I/O Library  0.0.5
Useful I/O Primitives.
Macros
host.h File Reference

Host environment detection. More...

#include <wfcnfo/compiler.h>
#include <wfcnfo/os.h>

Go to the source code of this file.

Macros

#define WFIO_OS_UNIX
 The host operating system is a UNIX-like OS. More...
 
#define WFIO_OS_DOS
 The host operating system is an MS DOS-like operating system. More...
 
#define WFIO_OS_WIN16
 The host operating system is 16-bit Windows. More...
 
#define WFIO_OS_WIN32
 The host operating system is 32-bit Windows. More...
 
#define WFIO_OS_WIN64
 The host operating system is 64-bit Windows. More...
 
#define WFIO_OS_WINDOWS
 The host operating system is Windows. More...
 
#define WFIO_OS_BEOS
 The host operating system is BeOS. More...
 
#define WFIO_OS_HAIKU
 The host operating system is Haiku. More...
 
#define WFIO_COMPILER_GCC
 The host compiler is the GNU Compiler Collection. More...
 
#define WFIO_COMPILER_MSVC
 The host compiler is Microsoft Visual C. More...
 
#define WFIO_COMPILER_DJGPP
 The host compiler is DJ's GNU Programming Platform. More...
 
#define WFIO_ARCH_8086
 The target compiler supports the Intel 8086 instruction set. More...
 
#define WFIO_ARCH_I286
 The target compiler supports the Intel 80286 instruction set. More...
 
#define WFIO_ARCH_I386
 The target compiler supports the Intel 80386 instruction set. More...
 
#define WFIO_ARCH_I486
 The target compiler supports the Intel 80486 instruction set. More...
 
#define WFIO_ARCH_I586
 The target compiler supports the Intel Pentium instruction set. More...
 
#define WFIO_ARCH_I686
 The target compiler supports the Intel Pentium Pro instruction set. More...
 
#define WFIO_ARCH_AMD64
 The target compiler supports a 64-bit Intel x86 processor. More...
 
#define WFIO_ARCH_IA16
 The target compiler supports a 16-bit Intel x86 processor. More...
 
#define WFIO_ARCH_IA32
 The target compiler supports a 32-bit Intel x86 processor. More...
 
#define WFIO_ENDIAN_DEFINED
 
#define WFIO_OS_WINDOWS
 The host operating system is Windows. More...
 
#define WFIO_EXPORT   WFCNFO_KW_DLLEXPORT
 Mark this symbol for export. More...
 
#define WFIO_IMPORT   WFCNFO_KW_DLLIMPORT
 Mark this symbol for import. More...
 
#define WFIO_INLINE   WFCNFO_KW_CINLINE
 Mark this symbol for inlining. More...
 
#define WFIO_DLL   WFIO_IMPORT
 Mark the symbol as an element of the library. More...
 
#define WFIO_CXX_DLL   WFIO_IMPORT
 
#define WFIO_FASTCALL   WFCNFO_KW_FASTCALL
 Mark the symbol as using the fastcall convention. More...
 
#define WFIO_DLL_FASTCALL   WFIO_DLL WFIO_FASTCALL
 Shorthand for WFIO_DLL WFIO_FASTCALL.
 
#define WFIO_ALWAYS_INLINE   WFCNFO_ALWAYS_INLINE
 Mark this symbol to be forced inline. More...
 
#define WFIO_THREAD_LOCAL   WFCNFO_KW_THREADLOCAL
 Mark this symbol as thread-local.
 
#define WFIO_MAYBE_INLINE
 Potentially mark this symbol for inlining. More...
 
#define WFIO_C_BEGIN   WFCNFO_C_BEGIN
 
#define WFIO_C_END   WFCNFO_C_END
 

Detailed Description

Host environment detection.

Author
Phillip Kilgore
Since
0.0.1

Macro Definition Documentation

◆ WFIO_ALWAYS_INLINE

#define WFIO_ALWAYS_INLINE   WFCNFO_ALWAYS_INLINE

Mark this symbol to be forced inline.

For compilers that support it, this attribute forces the corresponding function to be inlined. This can be used for functions that are so trivial that they should always be inlined. For those compilers that do not support this feature, this attribute has the same effect as WFIO_INLINE.

Warning
Care should be used with this attribute as it can dramatically increase code size. Typically, it is better to use WFIO_INLINE so that the compiler has the chance to decide against inlining. The best use case for this are function which directly and singularly invoke another function without performing any substantial modification to the parameters.
See also
WFIO_INLINE
WFIO_MAYBE_INLINE

◆ WFIO_ARCH_8086

#define WFIO_ARCH_8086

The target compiler supports the Intel 8086 instruction set.

This macro is defined iff the host architecture supports the 8086 instruction set.

◆ WFIO_ARCH_AMD64

#define WFIO_ARCH_AMD64

The target compiler supports a 64-bit Intel x86 processor.

This macro is defined only if the compiler is setup for a 64-bit Intel environment.

◆ WFIO_ARCH_I286

#define WFIO_ARCH_I286

The target compiler supports the Intel 80286 instruction set.

This macro is defined iff the host architecture supports the 80286 instruction set.

◆ WFIO_ARCH_I386

#define WFIO_ARCH_I386

The target compiler supports the Intel 80386 instruction set.

This macro is defined iff the host architecture supports the 80386 instruction set.

◆ WFIO_ARCH_I486

#define WFIO_ARCH_I486

The target compiler supports the Intel 80486 instruction set.

This macro is defined iff the host architecture supports the 80486 instruction set.

◆ WFIO_ARCH_I586

#define WFIO_ARCH_I586

The target compiler supports the Intel Pentium instruction set.

This macro is defined iff the host architecture supports the Pentium instruction set.

◆ WFIO_ARCH_I686

#define WFIO_ARCH_I686

The target compiler supports the Intel Pentium Pro instruction set.

This macro is defined iff the host architecture supports the Pentium Pro instruction set.

◆ WFIO_ARCH_IA16

#define WFIO_ARCH_IA16

The target compiler supports a 16-bit Intel x86 processor.

This macro is defined only if the compiler is setup for a 16-bit Intel environment.

◆ WFIO_ARCH_IA32

#define WFIO_ARCH_IA32

The target compiler supports a 32-bit Intel x86 processor.

This macro is defined only if the compiler is setup for a 32-bit Intel environment.

◆ WFIO_C_BEGIN

#define WFIO_C_BEGIN   WFCNFO_C_BEGIN
Parameters
Begina C block.

This macro is used to the beginning of code intended for use in C. This is needed because without it, name mangling may rename the symbols to something not recognizable by C.

◆ WFIO_C_END

#define WFIO_C_END   WFCNFO_C_END
Parameters
Enda C block.

This macro is used to close a C block opened with WFIO_C_BEGIN.

◆ WFIO_COMPILER_DJGPP

#define WFIO_COMPILER_DJGPP

The host compiler is DJ's GNU Programming Platform.

This macro is defined iff the host compiler is DJGPP or is compatible with it.

◆ WFIO_COMPILER_GCC

#define WFIO_COMPILER_GCC

The host compiler is the GNU Compiler Collection.

This macro is defined iff the host compiler is GCC or is compatible with it. As many compilers are written to be compatible with GCC, this may refer to a compiler other.

◆ WFIO_COMPILER_MSVC

#define WFIO_COMPILER_MSVC

The host compiler is Microsoft Visual C.

This macro is defined iff the host compiler is Microsoft Visual C or is compatible with it.

◆ WFIO_DLL

#define WFIO_DLL   WFIO_IMPORT

Mark the symbol as an element of the library.

With some compilers, it is necessary to explicitly mark symbols as exported in order for them to be visible by the linker. This attribute wraps around WFIO_IMPORT and WFIO_EXPORT to ensure that the direction of the symbol is properly accounted for.

◆ WFIO_EXPORT

#define WFIO_EXPORT   WFCNFO_KW_DLLEXPORT

Mark this symbol for export.

With some compilers, it is necessary to explicitly mark symbols as exported in order for them to be visible by the linker. This is equivalent to __declspec(dllexport) with MSVC.

◆ WFIO_FASTCALL

#define WFIO_FASTCALL   WFCNFO_KW_FASTCALL

Mark the symbol as using the fastcall convention.

On some architectures, a special convention exists where function arguments are propagated through registers rather than the stack. This can lead to improved performance for suitable candidates for architectures that support it. Although this references the x86, convention this macro denotes the usage of similar conventions.

This is merely a suggestion to the compiler; when it is not supported, this macro is expanded to nothing.

◆ WFIO_IMPORT

#define WFIO_IMPORT   WFCNFO_KW_DLLIMPORT

Mark this symbol for import.

With some compilers, it is necessary to explicitly mark symbols as exported in order for them to be visible by the linker. This is equivalent to __declspec(import) with MSVC.

◆ WFIO_INLINE

#define WFIO_INLINE   WFCNFO_KW_CINLINE

Mark this symbol for inlining.

This attribute has the same effect as static inline in C99 compilers. The compiler may make a decision about whether or not to inline the symbol; if it does not, the compiler will treat it as a static function.

See also
WFIO_ALWAYS_INLINE
WFIO_MAYBE_INLINE

◆ WFIO_MAYBE_INLINE

#define WFIO_MAYBE_INLINE

Potentially mark this symbol for inlining.

This symbol is defined conditionally in header files that use it to indicate that the function may be inlined. If it is not inlined, then it is permitted to have WFIO_DLL linkage.

Warning
This macro must be undefined in the same scope that defines it.

◆ WFIO_OS_BEOS

#define WFIO_OS_BEOS

The host operating system is BeOS.

This macro is defined iff the operating system is BeOS or some compatible implementation.

◆ WFIO_OS_DOS

#define WFIO_OS_DOS

The host operating system is an MS DOS-like operating system.

This macro is defined iff the operating system is Microsoft DOS or a compatible operating system.

◆ WFIO_OS_HAIKU

#define WFIO_OS_HAIKU

The host operating system is Haiku.

This macro is defined iff the operating system is Haiku.

◆ WFIO_OS_UNIX

#define WFIO_OS_UNIX

The host operating system is a UNIX-like OS.

This macro is defined iff the compiler claims that the host is compatible with UNIX.

◆ WFIO_OS_WIN16

#define WFIO_OS_WIN16

The host operating system is 16-bit Windows.

This macro is defined iff the operating system is a 16-bit variant of Windows or some compatible implementation.s

◆ WFIO_OS_WIN32

#define WFIO_OS_WIN32

The host operating system is 32-bit Windows.

This macro is defined iff the operating system is a 32-bit variant of Windows or some compatible implementation.

◆ WFIO_OS_WIN64

#define WFIO_OS_WIN64

The host operating system is 64-bit Windows.

This macro is defined iff the operating system is a 64-bit variant of Windows or some compatible implementation.

◆ WFIO_OS_WINDOWS [1/2]

#define WFIO_OS_WINDOWS

The host operating system is Windows.

This macro is defined iff the operating system is Windows or some compatible implementation.

◆ WFIO_OS_WINDOWS [2/2]

#define WFIO_OS_WINDOWS

The host operating system is Windows.

This macro is defined iff the operating system is Windows or some compatible implementation.