diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/replicant/nswasabi/ServiceName.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/replicant/nswasabi/ServiceName.h')
-rw-r--r-- | Src/replicant/nswasabi/ServiceName.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Src/replicant/nswasabi/ServiceName.h b/Src/replicant/nswasabi/ServiceName.h new file mode 100644 index 00000000..27b1cf2a --- /dev/null +++ b/Src/replicant/nswasabi/ServiceName.h @@ -0,0 +1,21 @@ +#pragma once +#include "../nx/nxstring.h" + +/* +this is a helper class to implement GetServiceName +just put WASABI_SERVICE_NAME("Your Service Name"); in the public section of your class declaration. +this implementation does leak memory, but I don't think it's that big of a deal (services can't be unloaded at run-time anyway) +if we ever implement the NXSTR() macro, we can eliminate this leak + +e.g. +class MyAPI : public api_whatever +{ +public: + WASABI_SERVICE_NAME("My API"); +}; + */ + +#define WASABI_SERVICE_NAME(x) static nx_string_t GetServiceName(){ static nx_string_t service_name=0; if (!service_name) NXStringCreateWithUTF8(&service_name, x); return NXStringRetain(service_name); } +#define WASABI_SERVICE_GUID(x) static GUID GetServiceGUID() { return x; } + + |