From f312f93a095fd742624c1c304acd9f7c852eb71f Mon Sep 17 00:00:00 2001 From: Dmitry Mikushin Date: Mon, 13 May 2024 09:01:26 +0200 Subject: [PATCH] Replace #if WIN32 with more conventional #ifdef _WIN32 --- tray.h | 114 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/tray.h b/tray.h index ba20cbc..83d2bbe 100644 --- a/tray.h +++ b/tray.h @@ -1,57 +1,57 @@ -#ifndef TRAY_H -#define TRAY_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -#if WIN32 -#ifdef TRAY_EXPORTS -#define TRAY_EXPORT __declspec(dllexport) -#else -#define TRAY_EXPORT __declspec(dllimport) -#endif -#else -#if __GNUC__ >= 4 || defined(__clang__) -#define TRAY_EXPORT extern __attribute__((visibility("default"))) -#else -#define TRAY_EXPORT extern -#endif -#endif - -struct tray { - const char *icon_filepath; - const char *tooltip; - void (*cb)(struct tray *); // called on left click, leave null to just open menu - struct tray_menu_item *menu; -}; - -struct tray_menu_item { - const char *text; - int disabled; - int checked; - void (*cb)(struct tray_menu_item *); - struct tray_menu_item *submenu; -}; - -TRAY_EXPORT -struct tray * tray_get_instance(); - -TRAY_EXPORT -int tray_init(struct tray *tray); - -TRAY_EXPORT -int tray_loop(int blocking); - -TRAY_EXPORT -void tray_update(struct tray *tray); - -TRAY_EXPORT -void tray_exit(void); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif /* TRAY_H */ +#ifndef TRAY_H +#define TRAY_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#ifdef _WIN32 +#ifdef TRAY_EXPORTS +#define TRAY_EXPORT __declspec(dllexport) +#else +#define TRAY_EXPORT __declspec(dllimport) +#endif +#else +#if __GNUC__ >= 4 || defined(__clang__) +#define TRAY_EXPORT extern __attribute__((visibility("default"))) +#else +#define TRAY_EXPORT extern +#endif +#endif + +struct tray { + const char *icon_filepath; + const char *tooltip; + void (*cb)(struct tray *); // called on left click, leave null to just open menu + struct tray_menu_item *menu; +}; + +struct tray_menu_item { + const char *text; + int disabled; + int checked; + void (*cb)(struct tray_menu_item *); + struct tray_menu_item *submenu; +}; + +TRAY_EXPORT +struct tray * tray_get_instance(); + +TRAY_EXPORT +int tray_init(struct tray *tray); + +TRAY_EXPORT +int tray_loop(int blocking); + +TRAY_EXPORT +void tray_update(struct tray *tray); + +TRAY_EXPORT +void tray_exit(void); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif /* TRAY_H */