Last active
March 6, 2024 15:19
-
-
Save ryuukk/a97dedbb9f8c35c201d553520574fbe1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import core.demangle : demangle; | |
import core.stdc.string: strlen; | |
extern(C) int demangle_symbol(const(char*) mangled, char* buffer, size_t bufferLength) | |
{ | |
if (mangled == null) return 0; | |
auto ret = demangle( cast(char[]) mangled[0 .. strlen(mangled)], buffer[0 .. bufferLength] ); | |
buffer[ret.length] = 0; | |
return 1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
build: | |
dmd -c lib.d | |
dmd -oflibd_demangle.so lib.o -shared | |
install: | |
cp libd_demangle.so /usr/lib/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment