I move the project to older dependencies to support older OSs, starting with Windows 7 、 but then there is a problem with the transfer, in the 2017 version I pulled the function names through the __func__ macro, but in the 2010 version it gives me:

error C2065: '__func__`': undeclared identifier

Is it possible to transfer this macro, functions are simply unrealistically large numbers, and rewriting each name takes a very large amount of time?

UPD: Forgot to warn, you need the name of the function without a prefix of the class those. not libvlc::get_errmsg that returns the macro __FUNCTION__, but get_errmsg .

    2 answers 2

    Add definition

     #define __func__ __FUNCTION__ 

    and you don’t have to change all the code :) As long as you are working in Visual C ++, this is a safe solution. You can, if you fear, tie it for a specific version:

     #if _MSC_VER == 1600 #define __func__ __FUNCSIG__ #endif 

    In VC ++ 2010 there is no __func__ , but there is __FUNCTION__ .

    More informative, however, replacement

     #define __func__ __FUNCSIG__ 
    • one
      All the way around, there is no __FUNCTION__ in c ++, but there is __func__ . - VTT
    • @VTT Ugh, I meant VC ++ 2010 ... I work on three screens at the same time - here I am going astray ... - Harry

    https://msdn.microsoft.com/en-us/library/b0084kay(v=vs.100).aspx suggests that something like __FUNCTION__ :

     // Demonstrates functionality of __FUNCTION__, __FUNCDNAME__, and __FUNCSIG__ macros void exampleFunction() { printf("Function name: %s\n", __FUNCTION__); printf("Decorated function name: %s\n", __FUNCDNAME__); printf("Function signature: %s\n", __FUNCSIG__); // Sample Output // ------------------------------------------------- // Function name: exampleFunction // Decorated function name: ?exampleFunction@@YAXXZ // Function signature: void __cdecl exampleFunction(void) }