#include <stdbool.h>
#include "icd.h"
-STATIC_INLINE bool icd_format_is_undef(XGL_FORMAT format)
+static inline bool icd_format_is_undef(XGL_FORMAT format)
{
return (format == XGL_FMT_UNDEFINED);
}
bool icd_format_is_ds(XGL_FORMAT format);
-STATIC_INLINE bool icd_format_is_color(XGL_FORMAT format)
+static inline bool icd_format_is_color(XGL_FORMAT format)
{
return !(icd_format_is_undef(format) || icd_format_is_ds(format));
}
bool icd_format_is_compressed(XGL_FORMAT format);
-STATIC_INLINE int icd_format_get_block_width(XGL_FORMAT format)
+static inline int icd_format_get_block_width(XGL_FORMAT format)
{
/* all compressed formats use 4x4 blocks */
return (icd_format_is_compressed(format)) ? 4 : 1;
}
-STATIC_INLINE bool icd_blend_mode_is_dual_src(XGL_BLEND mode)
+static inline bool icd_blend_mode_is_dual_src(XGL_BLEND mode)
{
return (mode == XGL_BLEND_SRC1_COLOR) ||
(mode == XGL_BLEND_SRC1_ALPHA) ||
(mode == XGL_BLEND_ONE_MINUS_SRC1_ALPHA);
}
-STATIC_INLINE bool icd_pipeline_cb_att_needs_dual_source_blending(const XGL_PIPELINE_CB_ATTACHMENT_STATE *att)
+static inline bool icd_pipeline_cb_att_needs_dual_source_blending(const XGL_PIPELINE_CB_ATTACHMENT_STATE *att)
{
if (icd_blend_mode_is_dual_src(att->srcBlendColor) ||
icd_blend_mode_is_dual_src(att->srcBlendAlpha) ||
/**
* Return true if val is power of two, or zero.
*/
-STATIC_INLINE bool u_is_pow2(unsigned int val)
+static inline bool u_is_pow2(unsigned int val)
{
return ((val & (val - 1)) == 0);
}
-STATIC_INLINE int u_ffs(int val)
+static inline int u_ffs(int val)
{
#if defined(PLATFORM_LINUX)
return ffs(val);
#endif
}
-STATIC_INLINE unsigned int u_align(unsigned int val, unsigned alignment)
+static inline unsigned int u_align(unsigned int val, unsigned alignment)
{
assert(alignment && u_is_pow2(alignment));
return (val + alignment - 1) & ~(alignment - 1);
}
-STATIC_INLINE unsigned int u_minify(unsigned int val, unsigned level)
+static inline unsigned int u_minify(unsigned int val, unsigned level)
{
return (val >> level) ? val >> level : 1;
}
-STATIC_INLINE uint32_t u_fui(float f)
+static inline uint32_t u_fui(float f)
{
union {
float f;
return u.ui;
}
-STATIC_INLINE float u_uif(uint32_t ui)
+static inline float u_uif(uint32_t ui)
{
union {
float f;
return u.f;
}
-STATIC_INLINE int u_iround(float f)
+static inline int u_iround(float f)
{
if (f >= 0.0f)
return (int) (f + 0.5f);
#include <xglWsiWinExt.h>
#endif
-#ifndef STATIC_INLINE
-#if defined(PLATFORM_LINUX)
-#define STATIC_INLINE static inline
-#else
-#define STATIC_INLINE static
-#endif
-#endif
-
#include "icd.h"
#include "icd-alloc.h"
void *loaderData;
} XGL_LOADER_DATA;
-STATIC_INLINE void set_loader_magic_value(void *pNewObject) {
+static inline void set_loader_magic_value(void *pNewObject) {
XGL_LOADER_DATA *loader_info = (XGL_LOADER_DATA *) pNewObject;
loader_info->loaderMagic = ICD_LOADER_MAGIC;
}
-STATIC_INLINE bool valid_loader_magic_value(void *pNewObject) {
+static inline bool valid_loader_magic_value(void *pNewObject) {
const XGL_LOADER_DATA *loader_info = (XGL_LOADER_DATA *) pNewObject;
return loader_info->loaderMagic == ICD_LOADER_MAGIC;
}
#define XGLAPI __stdcall
// C99:
- #define STATIC_INLINE static
+#ifndef __cplusplus
+ #undef inline
+ #define inline __inline
+#endif // __cplusplus
#elif defined(__GNUC__)
// On other platforms using GCC, XGLAPI stays undefined
#define XGLAPI
-
- // C99:
- #define STATIC_INLINE static inline
#else
// Unsupported Platform!
#error "Unsupported OS Platform detected!"
stmts.append("#endif")
func = []
- func.append("STATIC_INLINE void %s_initialize_dispatch_table(XGL_LAYER_DISPATCH_TABLE *table,"
+ func.append("static inline void %s_initialize_dispatch_table(XGL_LAYER_DISPATCH_TABLE *table,"
% self.prefix)
func.append("%s xglGetProcAddrType gpa,"
% (" " * len(self.prefix)))
lookups.append("#endif")
func = []
- func.append("STATIC_INLINE void *%s_lookup_dispatch_table(const XGL_LAYER_DISPATCH_TABLE *table,"
+ func.append("static inline void *%s_lookup_dispatch_table(const XGL_LAYER_DISPATCH_TABLE *table,"
% self.prefix)
func.append("%s const char *name)"
% (" " * len(self.prefix)))
lookups.append("#endif")
body = []
- body.append("STATIC_INLINE %s layer_intercept_proc(const char *name)" %
+ body.append("static inline %s layer_intercept_proc(const char *name)" %
self.gpa.ret)
body.append("{")
body.append(generate_get_proc_addr_check("name"))
body = []
for bet in self.et_dict:
fet = self.tf_dict[bet]
- body.append("STATIC_INLINE uint32_t validate_%s(%s input_value)\n{\n switch ((%s)input_value)\n {" % (fet, fet, fet))
+ body.append("static inline uint32_t validate_%s(%s input_value)\n{\n switch ((%s)input_value)\n {" % (fet, fet, fet))
for e in sorted(self.et_dict[bet]):
if (self.ev_dict[e]['unique']):
body.append(' case %s:' % (e))
# bet == base_enum_type, fet == final_enum_type
for bet in self.et_dict:
fet = self.tf_dict[bet]
- body.append("STATIC_INLINE const char* string_%s(%s input_value)\n{\n switch ((%s)input_value)\n {" % (fet, fet, fet))
+ body.append("static inline const char* string_%s(%s input_value)\n{\n switch ((%s)input_value)\n {" % (fet, fet, fet))
for e in sorted(self.et_dict[bet]):
if (self.ev_dict[e]['unique']):
body.append(' case %s:\n return "%s";' % (e, e))
def _generateSHHeader(self):
header = []
header.append('#pragma once\n')
- header.append('#include <%s>\n' % self.in_file)
- header.append('#if defined(_WIN32)')
- header.append('#define STATIC_INLINE static')
- header.append('#else // defined(_WIN32)')
- header.append('#define STATIC_INLINE static inline')
- header.append('#endif // defined(_WIN32)\n\n\n')
+ header.append('#include <%s>\n\n\n' % self.in_file)
return "\n".join(header)