Starboard Module Reference: configuration.h

Provides a description of the current platform in lurid detail so that common code never needs to actually know what the current operating system and architecture are.
It is both very pragmatic and canonical in that if any application code finds itself needing to make a platform decision, it should always define a Starboard Configuration feature instead. This implies the continued existence of very narrowly-defined configuration features, but it retains porting control in Starboard.

Macros

SB_ARRAY_SIZE

A constant expression that evaluates to the size_t size of a statically-sized array.

SB_ARRAY_SIZE_INT

A constant expression that evaluates to the int size of a statically-sized array. Note that this macro's definition varies depending on the values of one or more other variables.

SB_CAN

Determines a compile-time capability of the system.

SB_CAN_MEDIA_USE_STARBOARD_PIPELINE

Specifies whether the starboard media pipeline components (SbPlayerPipeline and StarboardDecryptor) are used. Set to 0 means they are not used.

SB_COMPILE_ASSERT

Note that this macro's definition varies depending on the values of one or more other variables.

SB_DEPRECATED

SB_DEPRECATED(int Foo(int bar)); Annotates the function as deprecated, which will trigger a compiler warning when referenced. Note that this macro's definition varies depending on the values of one or more other variables.

SB_DEPRECATED_EXTERNAL

SB_DEPRECATED_EXTERNAL(...) annotates the function as deprecated for external clients, but not deprecated for starboard. Note that this macro's definition varies depending on the values of one or more other variables.

SB_DISALLOW_COPY_AND_ASSIGN

A macro to disallow the copy constructor and operator= functions This should be used in the private: declarations for a class

SB_EXPERIMENTAL_API_VERSION

The API version that is currently open for changes, and therefore is not stable or frozen. Production-oriented ports should avoid declaring that they implement the experimental Starboard API version.

SB_HAS

Determines at compile-time whether this platform has a standard feature or header available.

SB_HAS_64_BIT_ATOMICS

Whether the current platform has 64-bit atomic operations. Note that this macro's definition varies depending on the values of one or more other variables.

SB_HAS_GLES2

Specifies whether this platform has a performant OpenGL ES 2 implementation, which allows client applications to use GL rendering paths. Derived from the gyp variable 'gl_type' which indicates what kind of GL implementation is available.

SB_HAS_GRAPHICS

Specifies whether this platform has any kind of supported graphics system. Note that this macro's definition varies depending on the values of one or more other variables.

SB_HAS_QUIRK

Determines at compile-time whether this platform has a quirk.

SB_INT64_C

Declare numeric literals of specific 64-bit types. Note that this macro's definition varies depending on the values of one or more other variables.

SB_IS

Determines at compile-time an inherent aspect of this platform.

SB_IS_COMPILER_GCC

SB_IS_COMPILER_MSVC

SB_IS_LITTLE_ENDIAN

Whether the current platform is little endian. Note that this macro's definition varies depending on the values of one or more other variables.

SB_LIKELY

Macro for hinting that an expression is likely to be true. Note that this macro's definition varies depending on the values of one or more other variables.

SB_MAXIMUM_API_VERSION

The maximum API version allowed by this version of the Starboard headers, inclusive.

SB_MINIMUM_API_VERSION

The minimum API version allowed by this version of the Starboard headers, inclusive.

SB_OVERRIDE

Declares a function as overriding a virtual function on compilers that support it. Note that this macro's definition varies depending on the values of one or more other variables.

SB_PREFERRED_RGBA_BYTE_ORDER_ARGB

An enumeration of values for the SB_PREFERRED_RGBA_BYTE_ORDER configuration variable. Setting this up properly means avoiding slow color swizzles when passing pixel data from one library to another. Note that these definitions are in byte-order and so are endianness-independent.

SB_PREFERRED_RGBA_BYTE_ORDER_BGRA

An enumeration of values for the SB_PREFERRED_RGBA_BYTE_ORDER configuration variable. Setting this up properly means avoiding slow color swizzles when passing pixel data from one library to another. Note that these definitions are in byte-order and so are endianness-independent.

SB_PREFERRED_RGBA_BYTE_ORDER_RGBA

An enumeration of values for the SB_PREFERRED_RGBA_BYTE_ORDER configuration variable. Setting this up properly means avoiding slow color swizzles when passing pixel data from one library to another. Note that these definitions are in byte-order and so are endianness-independent.

SB_PRINTF_FORMAT

Tells the compiler a function is using a printf-style format string. `format_param` is the one-based index of the format string parameter; `dots_param` is the one-based index of the "..." parameter. For v*printf functions (which take a va_list), pass 0 for dots_param. (This is undocumented but matches what the system C headers do.) (Partially taken from base/compiler_specific.h)

SB_RESTRICT

Makes a pointer-typed parameter restricted so that the compiler can make certain optimizations because it knows the pointers are unique. Note that this macro's definition varies depending on the values of one or more other variables.

SB_STRINGIFY

Standard CPP trick to stringify an evaluated macro definition.

SB_STRINGIFY2

Standard CPP trick to stringify an evaluated macro definition.

SB_UINT64_C

Declare numeric literals of specific 64-bit types. Note that this macro's definition varies depending on the values of one or more other variables.

SB_UNLIKELY

Macro for hinting that an expression is likely to be false. Note that this macro's definition varies depending on the values of one or more other variables.

SB_UNREFERENCED_PARAMETER

Trivially references a parameter that is otherwise unreferenced, preventing a compiler warning on some platforms. Note that this macro's definition varies depending on the values of one or more other variables.

SB_VERSION

Determines at compile-time if this platform implements a given Starboard API version number (or above).

SB_WARN_UNUSED_RESULT

Causes the annotated (at the end) function to generate a warning if the result is not accessed.