How to get the macro name from a compiled macro?

Hello, is there a way to get the macro name even if the macro is compiled.
Typically, I wrote this test.C example

[code]#include <TInterpreter.h>


using namespace std;

void test() {
cout << "gInterpreter->GetCurrentMacroName(): " << gInterpreter->GetCurrentMacroName() << endl;

If I type

I get what is expected: "test.C"
However, it does not work anymore if I compile the macro

instead of getting the macro name, I get an empty string.
Do you have any idea how to get the macro name of a compiled macro?
Thank you in advance.

Edit: I am using ROOT 5.34/25

Hi pamputt,

the difference in the two cases is that in the former setup you interpret the code with CINT, while in the second you compile a shared library and you call a function provided by it via a stub function contained in the dictionary aclic automatically generates.
A possible way out is to use the gcc/clang preprocessor macro FILE, for example

// file macro.C
#include <iostream>
int macro(){

std::cout << "**"<< __FILE__ << "**" <<std::endl;
return 0;


Indeed it works.
Thank you