[Bf-blender-cvs] [c7fc643728e] asset-browser-poselib: Attempt to fix build error on MSVC and warnings on some other compilers

Julian Eisel noreply at git.blender.org
Wed Apr 28 13:08:20 CEST 2021


Commit: c7fc643728e1a19401bd144231dea21ee14a4144
Author: Julian Eisel
Date:   Wed Apr 28 13:03:17 2021 +0200
Branches: asset-browser-poselib
https://developer.blender.org/rBc7fc643728e1a19401bd144231dea21ee14a4144

Attempt to fix build error on MSVC and warnings on some other compilers

On MSVC it failed with this error:
```
source\blender\blenkernel\BKE_context.h(361,20): error C2526:
'CTX_wm_asset_handle': C linkage function cannot return C++ class 'AssetHandle'
```

On Apple Clang I would get this:
```
warning: 'CTX_wm_asset_handle' has C-linkage specified, but returns incomplete
type 'struct AssetHandle' which could be incompatible with C
[-Wreturn-type-c-linkage]
struct AssetHandle CTX_wm_asset_handle(const bContext *C, bool *r_is_valid);
                   ^
1 warning generated.
```

Just include the asset header defining the type for now, it should later on be
solved properly with a better design for `AssetHandle`.

===================================================================

M	source/blender/blenkernel/BKE_context.h

===================================================================

diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h
index ca2cd077b33..8917580689d 100644
--- a/source/blender/blenkernel/BKE_context.h
+++ b/source/blender/blenkernel/BKE_context.h
@@ -23,6 +23,9 @@
  * \ingroup bke
  */
 
+/* XXX temporary, until AssetHandle is designed properly and queries can return a pointer to it. */
+#include "DNA_asset_types.h"
+
 #include "DNA_listBase.h"
 #include "DNA_object_enums.h"
 #include "RNA_types.h"



More information about the Bf-blender-cvs mailing list