Skip to content

Intrinsic Defines

Paul Squires edited this page Oct 14, 2026 · 3 revisions

Home › Intrinsic Defines › Intrinsic Defines

Intrinsic Defines

Preprocessor symbols defined by the compiler.

Description

Intrinsic defines are set by the compiler and may be used as any other defined symbol. Intrinsic defines often convey information about the state of the compiler, either in general or at a specific point in the compilation process. Most intrinsic defines are associated with a value.

Platform Information

Defines that provide information on the system.

Version Information

Defines that provide information on the compiler version being used.

Command-line switches

Defines that provide information with the command-line switches used with the compiler.

Environment Information

Defines that provide information about the operating system environment.

Context-specific Information

Defines that provide context information about the compilation process.

Basic-macros

Built-in basic-macros.

Constants

Built-in constants.

Platform Information

__FB_WIN32__

Defined if compiling for Windows.

__FB_LINUX__

Defined if compiling for Linux.

__FB_DOS__

Defined if compiling for DOS.

__FB_CYGWIN__

Defined if compiling for Cygwin.

__FB_FREEBSD__

Defined if compiling for FreeBSD.

__FB_NETBSD__

Defined if compiling for NetBSD.

__FB_OPENBSD__

Defined if compiling for OpenBSD.

__FB_DARWIN__

Defined if compiling for Darwin.

__FB_XBOX__

Defined if compiling for Xbox.

__FB_BIGENDIAN__

Defined if compiling on a system using big-endian byte-order.

__FB_PCOS__

Defined if compiling for a common PC OS (e.g. DOS, Windows, OS/2).

__FB_UNIX__

Defined if compiling for a Unix-like OS.

__FB_64BIT__

Defined if compiling for a 64bit target.

__FB_ARM__

Defined if compiling for the ARM architecture.

__FB_PPC__

Defined if compiling for the PowerPC architecture.

__FB_X86__

Defined if compiling for the X86 / X86_64 architecture.

__FB_JS__

Defined if compiling for emscripten target.

__FB_ANDROID__

Defined if compiling for android target.

Version Information

__FB_VERSION__

Defined as a string literal of the compiler version.

__FB_VER_MAJOR__

Defined as an integral literal of the compiler major version number.

__FB_VER_MINOR__

Defined as an integral literal of the compiler minor version number.

__FB_VER_PATCH__

Defined as an integral literal of the compiler patch number.

__FB_MIN_VERSION__

Macro to check for a minimum compiler version.

__FB_BUILD_DATE__

Defined as a string literal of the compiler build date in "mm-dd-yyyy" format.

__FB_BUILD_DATE_ISO__

Defined as a string literal of the compiler build date in "yyyy-mm-dd" format.

__FB_SIGNATURE__

Defined as a string literal of the compiler signature.

__FB_BUILD_SHA1__

Defined as a string literal of the compiler's source revision sha-1.

__FB_BUILD_FORK_ID__

Defined as a string literal of the custom defined project fork identifier name.

Command-line switches

__FB_ASM__

Defined to either "intel" or "att" depending on -asm.

__FB_BACKEND__

Defined to either "gas" or "gcc" depending on -gen.

__FB_GCC__

True (-1) if -gen gcc is used, false (0) otherwise.

__FB_OPTIMIZE__

Defined to the optimization level depending on -O.

__FB_GUI__

True (-1) if the "-s gui" switch was used, false (0) otherwise.

__FB_MAIN__

Defined if compiling a module with an entry point.

__FB_DEBUG__

True (-1) if the "-g" switch was used, false (0) otherwise.

__FB_ERR__

Zero (0) if neither the "-e", "-ex" or "-exx" switches were used.

__FB_FPMODE__

Defined as "fast" if compiling for fast SSE math, "precise" otherwise.

__FB_FPU__

Defined as "sse" if compiling for SSE floating point unit, or "x87" for normal x87 floating-point unit.

__FB_LANG__

Defined to a string literal of the "-lang" dialect used.

__FB_MT__

True (-1) if the "-mt" switch was used, false (0) otherwise.

__FB_OUT_DLL__

True (-1) in a module being compiled and linked into a shared library, false (0) otherwise.

__FB_OUT_EXE__

True (-1) in a module being compiled and linked into an executable, false (0) otherwise.

__FB_OUT_LIB__

True (-1) in a module being compiled and linked into a static library, zero (0) otherwise.

__FB_OUT_OBJ__

True (-1) in a module being compiled only, zero (0) otherwise.

__FB_PROFILE__

Set to an integer to indicate the profiling method.

__FB_SSE__

Defined if compiling for SSE floating point unit.

__FB_VECTORIZE__

Defined as the level of automatic vectorization (0 to 2)

Environment Information

__FB_ARGC__

Defined as an integer literal of the number of command-line arguments passed to the program.

__FB_ARGV__

Defined as a ZString Ptr Ptr to the command line arguments passed to the program.

__DATE__

Defined as a string literal of the compilation date in "mm-dd-yyyy" format.

__DATE_ISO__

Defined as a string literal of the compilation date in "yyyy-mm-dd" format.

__TIME__

Defined as a string literal of the compilation time.

__PATH__

Defined as a string literal of the absolute path of the module.

Context-specific Information

__FILE__ and __FILE_NQ__

Defined as the name of the module.

__FUNCTION__ and __FUNCTION_NQ__

Defined as the name of the procedure where it's used.

__LINE__

Defined as an integer literal of the line of the module where it's used.

__FB_OPTION_BYVAL__

True (-1) if parameters are declared by value by default, zero (0) otherwise.

__FB_OPTION_DYNAMIC__

True (-1) if all arrays are variable-length, zero (0) otherwise.

__FB_OPTION_ESCAPE__

True (-1) if string literals are processed for escape sequences, zero (0) otherwise.

__FB_OPTION_GOSUB__

True (-1) if gosub support is enabled, zero (0) otherwise.

__FB_OPTION_EXPLICIT__

True (-1) if variables and objects need to be explicitly declared, zero (0) otherwise.

__FB_OPTION_PRIVATE__

True (-1) if all procedures are private by default, zero (0) otherwise.

__FB_OPTION_PROFILE__

True (-1) if profiling code is generated, zero (0) otherwise.

Basic-macros

__FB_ARG_COUNT__

Counts the number of arguments in an argument list.

__FB_ARG_EXTRACT__

Returns nth argument from an argument list.

__FB_ARG_LEFTOF__

Returns left token based on separator.

__Fb_Arg_Listexpand__

Expands a macro one or more time on an argument list

__FB_ARG_RIGHTOF__

Returns right token based on separator.

__FB_EVAL__

Evaluates an argument (expression) at compile time.

__FB_IIF__

Returns an expression depending on the result of a comparison expression evaluated at compile time.

__FB_JOIN__

Joins two token arguments together as one.

__Fb_Query_Symbol__

Queries the compiler's symbol internals.

__FB_QUOTE__

Converts the argument to a string.

__FB_UNIQUEID__

Gets the identifier at the top of a stack.

__FB_UNIQUEID_POP__

Pops an identifier off of a stack.

__FB_UNIQUEID_PUSH__

Pushes a new unique identifier on to a stack.

__FB_UNQUOTE__

Takes a literal string and converts it back to tokens.

Constants

False and True

Intrinsic constants for the Boolean data type.


Category: Intrinsic Defines


Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.

Clone this wiki locally