Skip to content

vt/arrayedit.h missing a VT_API on friend function declaration #4034

@marktucker

Description

@marktucker

In vt/arrayEdit.h, inside the class we have:

    friend
    std::ostream &Vt_ArrayEditStreamImpl(
        Vt_ArrayEditOps const &ops, size_t literalsSize,
        TfFunctionRef<std::ostream &(int64_t index)> elemToStr,
        std::ostream &out);

Then later in the header we have:

VT_API
std::ostream &Vt_ArrayEditStreamImpl(
    Vt_ArrayEditOps const &ops, size_t literalsSize,
    TfFunctionRef<std::ostream &(int64_t index)> streamElem,
    std::ostream &out);

When we include this header, we get a warning:

C:\cygwin\home\prisms\builder-new\NightlyHEADCMake\dev\hfs\custom\include\pxr/base/vt/arrayEdit.h(199): warning C4273: 'pxrInternal_v0_26_3__pxrReserved__::Vt_ArrayEditStreamImpl': inconsistent dll linkage

The fix is to change the "friend" declaration to "VT_API friend". This same patterin is used in vt/value.h (just search for "VT_API friend").

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions