nvim-treesitter-cpp-tools icon indicating copy to clipboard operation
nvim-treesitter-cpp-tools copied to clipboard

MYLIBRARY_EXPORT dll export not work

Open paopaol opened this issue 3 years ago • 3 comments

if the class written as

class MyClass{
//some method
};

it works fine.

but

class  MYLIBRARY_EXPORT MyClass{
//some method
};

not works.

paopaol avatar May 20 '22 10:05 paopaol

Im not sure about the implementation of functions for this case. Could you give an example?

class  MYLIBRARY_EXPORT MyClass{
    void test();
};

Should it be

void MyClass::test() {
}

Also I'm curious about the use cases of MYLIBRARY_EXPORT. Is it a macro? Is it used for Windows?

Badhi avatar May 20 '22 15:05 Badhi

yes , for windows.

#ifdef WIN32
  #ifdef MY_LIB
    #define MYLIBRARY_EXPORT __declspec(dllexport)
  #else
    #define MYLIBRARY_EXPORT  __declspec(dllimport)
  #endif
#else 
  #define MYLIBRARY_EXPORT 
#endif

class  MYLIBRARY_EXPORT MyClass{
    void test();
};


paopaol avatar May 21 '22 02:05 paopaol

A proper solution cannot be given until this issue is fixed from the cpp treesitter parser

Badhi avatar May 21 '22 07:05 Badhi