From eb781ce68953b90cf932bea6c724ebcf8b707226 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 3 Sep 2022 18:09:01 -0500 Subject: [PATCH] Use __FUNCTION__ macro instead of hardcoding --- app/masterhook.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/masterhook.c b/app/masterhook.c index 34063e43..902403be 100644 --- a/app/masterhook.c +++ b/app/masterhook.c @@ -69,7 +69,7 @@ int drmModeSetCrtc(int fd, uint32_t crtcId, uint32_t bufferId, } // Call into the real thing - return ((typeof(drmModeSetCrtc)*)dlsym(RTLD_NEXT, "drmModeSetCrtc"))(fd, crtcId, bufferId, x, y, connectors, count, mode); + return ((typeof(drmModeSetCrtc)*)dlsym(RTLD_NEXT, __FUNCTION__))(fd, crtcId, bufferId, x, y, connectors, count, mode); } // This hook will handle atomic DRM rendering @@ -87,7 +87,7 @@ int drmModeAtomicCommit(int fd, drmModeAtomicReqPtr req, } // Call into the real thing - return ((typeof(drmModeAtomicCommit)*)dlsym(RTLD_NEXT, "drmModeAtomicCommit"))(fd, req, flags, user_data); + return ((typeof(drmModeAtomicCommit)*)dlsym(RTLD_NEXT, __FUNCTION__))(fd, req, flags, user_data); } // This hook will handle SDL's open() on the DRM device. We just need to @@ -156,7 +156,7 @@ int open(const char *pathname, int flags, ...) { va_list va; va_start(va, flags); - int fd = openHook("open", pathname, flags, va); + int fd = openHook(__FUNCTION__, pathname, flags, va); va_end(va); return fd; } @@ -165,7 +165,7 @@ int open64(const char *pathname, int flags, ...) { va_list va; va_start(va, flags); - int fd = openHook("open64", pathname, flags, va); + int fd = openHook(__FUNCTION__, pathname, flags, va); va_end(va); return fd; } @@ -175,7 +175,7 @@ int open64(const char *pathname, int flags, ...) int close(int fd) { // Call the real thing - int ret = ((typeof(close)*)dlsym(RTLD_NEXT, "close"))(fd); + int ret = ((typeof(close)*)dlsym(RTLD_NEXT, __FUNCTION__))(fd); if (ret == 0) { // If we just closed the SDL DRM master FD, restore master // to the Qt DRM FD. This works because the Qt DRM master FD