Fix compiler error in stubs because some headers are now C++

All the stubs used to be extern "C", now a few of them are not anymore.
E.g. `paint_is_face_hidden`.
This commit is contained in:
Jacques Lucke
2023-08-03 13:15:53 +02:00
parent d8a860b605
commit 359f8d0559

View File

@@ -34,23 +34,23 @@
#include "UI_resources.h"
extern "C" {
Global G;
UserDef U;
}
/* -------------------------------------------------------------------- */
/** \name Stubs of BLI_imbuf_types.h
* \{ */
void IMB_freeImBuf(ImBuf * /*ibuf*/)
extern "C" void IMB_freeImBuf(ImBuf * /*ibuf*/)
{
BLI_assert_unreachable();
}
struct ImBuf *IMB_allocImBuf(unsigned int /*x*/,
unsigned int /*y*/,
unsigned char /*planes*/,
unsigned int /*flags*/)
extern "C" struct ImBuf *IMB_allocImBuf(unsigned int /*x*/,
unsigned int /*y*/,
unsigned char /*planes*/,
unsigned int /*flags*/)
{
BLI_assert_unreachable();
return nullptr;
@@ -62,43 +62,46 @@ struct ImBuf *IMB_allocImBuf(unsigned int /*x*/,
/** \name Stubs of UI_resources.h
* \{ */
void UI_GetThemeColor4fv(int /*colorid*/, float[4] /*col*/)
extern "C" void UI_GetThemeColor4fv(int /*colorid*/, float[4] /*col*/)
{
BLI_assert_unreachable();
}
void UI_GetThemeColor3fv(int /*colorid*/, float[3] /*col*/)
extern "C" void UI_GetThemeColor3fv(int /*colorid*/, float[3] /*col*/)
{
BLI_assert_unreachable();
}
void UI_GetThemeColorShade4fv(int /*colorid*/, int /*offset*/, float[4] /*col*/)
extern "C" void UI_GetThemeColorShade4fv(int /*colorid*/, int /*offset*/, float[4] /*col*/)
{
BLI_assert_unreachable();
}
void UI_GetThemeColorShadeAlpha4fv(int /*colorid*/,
int /*coloffset*/,
int /*alphaoffset*/,
float[4] /*col*/)
extern "C" void UI_GetThemeColorShadeAlpha4fv(int /*colorid*/,
int /*coloffset*/,
int /*alphaoffset*/,
float[4] /*col*/)
{
BLI_assert_unreachable();
}
void UI_GetThemeColorBlendShade4fv(
extern "C" void UI_GetThemeColorBlendShade4fv(
int /*colorid1*/, int /*colorid2*/, float /*fac*/, int /*offset*/, float[4] /*col*/)
{
BLI_assert_unreachable();
}
void UI_GetThemeColorBlend3ubv(int /*colorid1*/, int /*colorid2*/, float /*fac*/, uchar[3] /*col*/)
extern "C" void UI_GetThemeColorBlend3ubv(int /*colorid1*/,
int /*colorid2*/,
float /*fac*/,
uchar[3] /*col*/)
{
BLI_assert_unreachable();
}
void UI_GetThemeColorShadeAlpha4ubv(int /*colorid*/,
int /*coloffset*/,
int /*alphaoffset*/,
uchar[4] /*col*/)
extern "C" void UI_GetThemeColorShadeAlpha4ubv(int /*colorid*/,
int /*coloffset*/,
int /*alphaoffset*/,
uchar[4] /*col*/)
{
BLI_assert_unreachable();
}
@@ -109,8 +112,8 @@ void UI_GetThemeColorShadeAlpha4ubv(int /*colorid*/,
/** \name Stubs of BKE_attribute.h
* \{ */
eAttrDomain BKE_id_attribute_domain(const struct ID * /*id*/,
const struct CustomDataLayer * /*layer*/)
extern "C" eAttrDomain BKE_id_attribute_domain(const struct ID * /*id*/,
const struct CustomDataLayer * /*layer*/)
{
return ATTR_DOMAIN_AUTO;
}
@@ -156,7 +159,7 @@ bool paint_is_grid_face_hidden(const uint * /*grid_hidden*/,
/** \name Stubs of BKE_material.h
* \{ */
void BKE_material_defaults_free_gpu()
extern "C" void BKE_material_defaults_free_gpu()
{
/* This function is reachable via GPU_exit. */
}
@@ -167,30 +170,32 @@ void BKE_material_defaults_free_gpu()
/** \name Stubs of BKE_customdata.h
* \{ */
int CustomData_get_offset(const struct CustomData * /*data*/, eCustomDataType /*type*/)
extern "C" int CustomData_get_offset(const struct CustomData * /*data*/, eCustomDataType /*type*/)
{
BLI_assert_unreachable();
return 0;
}
int CustomData_get_named_layer_index(const struct CustomData * /*data*/,
eCustomDataType /*type*/,
const char * /*name*/)
extern "C" int CustomData_get_named_layer_index(const struct CustomData * /*data*/,
eCustomDataType /*type*/,
const char * /*name*/)
{
return -1;
}
int CustomData_get_active_layer_index(const struct CustomData * /*data*/, eCustomDataType /*type*/)
extern "C" int CustomData_get_active_layer_index(const struct CustomData * /*data*/,
eCustomDataType /*type*/)
{
return -1;
}
int CustomData_get_render_layer_index(const struct CustomData * /*data*/, eCustomDataType /*type*/)
extern "C" int CustomData_get_render_layer_index(const struct CustomData * /*data*/,
eCustomDataType /*type*/)
{
return -1;
}
bool CustomData_has_layer(const struct CustomData * /*data*/, eCustomDataType /*type*/)
extern "C" bool CustomData_has_layer(const struct CustomData * /*data*/, eCustomDataType /*type*/)
{
return false;
}
@@ -211,18 +216,19 @@ int BKE_subdiv_ccg_grid_to_face_index(const SubdivCCG * /*subdiv_ccg*/, const in
/* -------------------------------------------------------------------- */
/** \name Stubs of BKE_node.h
* \{ */
void ntreeGPUMaterialNodes(struct bNodeTree * /*localtree*/, struct GPUMaterial * /*mat*/)
extern "C" void ntreeGPUMaterialNodes(struct bNodeTree * /*localtree*/,
struct GPUMaterial * /*mat*/)
{
BLI_assert_unreachable();
}
struct bNodeTree *ntreeLocalize(struct bNodeTree * /*ntree*/)
extern "C" struct bNodeTree *ntreeLocalize(struct bNodeTree * /*ntree*/)
{
BLI_assert_unreachable();
return nullptr;
}
void ntreeFreeLocalTree(struct bNodeTree * /*ntree*/)
extern "C" void ntreeFreeLocalTree(struct bNodeTree * /*ntree*/)
{
BLI_assert_unreachable();
}
@@ -232,7 +238,7 @@ void ntreeFreeLocalTree(struct bNodeTree * /*ntree*/)
/* -------------------------------------------------------------------- */
/** \name Stubs of bmesh.h
* \{ */
void BM_face_as_array_vert_tri(BMFace * /*f*/, BMVert *[3] /*r_verts*/)
extern "C" void BM_face_as_array_vert_tri(BMFace * /*f*/, BMVert *[3] /*r_verts*/)
{
BLI_assert_unreachable();
}
@@ -241,17 +247,17 @@ void BM_face_as_array_vert_tri(BMFace * /*f*/, BMVert *[3] /*r_verts*/)
/* -------------------------------------------------------------------- */
/** \name Stubs of DRW_engine.h
* \{ */
void DRW_deferred_shader_remove(struct GPUMaterial * /*mat*/)
extern "C" void DRW_deferred_shader_remove(struct GPUMaterial * /*mat*/)
{
BLI_assert_unreachable();
}
void DRW_cdlayer_attr_aliases_add(struct GPUVertFormat * /*format*/,
const char * /*base_name*/,
const struct CustomData * /*data*/,
const struct CustomDataLayer * /*cl*/,
bool /*is_active_render*/,
bool /*is_active_layer*/)
extern "C" void DRW_cdlayer_attr_aliases_add(struct GPUVertFormat * /*format*/,
const char * /*base_name*/,
const struct CustomData * /*data*/,
const struct CustomDataLayer * /*cl*/,
bool /*is_active_render*/,
bool /*is_active_layer*/)
{
}
@@ -260,34 +266,33 @@ void DRW_cdlayer_attr_aliases_add(struct GPUVertFormat * /*format*/,
/* -------------------------------------------------------------------- */
/** \name Stubs of IMB_imbuf.h
* \{ */
struct ImBuf *IMB_ibImageFromMemory(const unsigned char * /*mem*/,
size_t /*size*/,
int /*flags*/,
char /*colorspace*/[IM_MAX_SPACE],
const char * /*descr*/)
extern "C" struct ImBuf *IMB_ibImageFromMemory(const unsigned char * /*mem*/,
size_t /*size*/,
int /*flags*/,
char /*colorspace*/[IM_MAX_SPACE],
const char * /*descr*/)
{
BLI_assert_unreachable();
return nullptr;
}
struct ImBuf *IMB_allocFromBuffer(const uint8_t * /*rect*/,
const float * /*rectf*/,
unsigned int /*w*/,
unsigned int /*h*/,
unsigned int /*channels*/)
extern "C" struct ImBuf *IMB_allocFromBuffer(const uint8_t * /*rect*/,
const float * /*rectf*/,
unsigned int /*w*/,
unsigned int /*h*/,
unsigned int /*channels*/)
{
BLI_assert_unreachable();
return nullptr;
}
bool IMB_saveiff(struct ImBuf * /*ibuf*/, const char * /*filepath*/, int /*flags*/)
extern "C" bool IMB_saveiff(struct ImBuf * /*ibuf*/, const char * /*filepath*/, int /*flags*/)
{
BLI_assert_unreachable();
return false;
}
/** \} */
}
/* -------------------------------------------------------------------- */
/** \name Stubs of BKE_pbvh.hh