Currently the macro declares the function qInitResource_XXXX with
extern int QT_MANGLE_NAMESPACE( qInitResource_ ## name )()
I would like to suggest its changed to
extern “C++” int QT_MANGLE_NAMESPACE( qInitResource_ ## name )()
The reason being is the following use case, I have a plugin (not a qt plugin,
but a plugin that uses qt including the resource system).
The main external API function call is defined as
extern “C” void apiCall()
{
Q_INIT_RESOURCE( resource );
}
Which causes a link error because the declaration of qInitResource_XXX is
extern int, but gets done under extern “C” language linking.
The working around for me, is to declare the apiCall and then define it.
extern “C” void apiCall()
void apiCall()
{
Q_INIT_RESOURCE( resource );
}
But while this seems awfully trivial now, it took me way too long to figure out
what was going on 😊
Changing the macro would fix this with zero downside.
Thought?
Scott
--
Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development