Refactored the HIDDEN macro into its own header
All checks were successful
Test And Build / Lint (push) Successful in 5s
Test And Build / Build (push) Successful in 5s

This commit is contained in:
2025-08-12 09:07:32 +02:00
parent c19e4845e4
commit 7965dd3b2e
5 changed files with 40 additions and 29 deletions

22
src/macros.h Normal file
View File

@@ -0,0 +1,22 @@
// Collection of macros used in sinqMotor and derived classes
#ifndef macros_H
#define macros_H
/*
The macro "HIDDEN" hides the symbol of the annotated class / function. This is
useful to avoid symbol clashes when loading multiple shared libraries in a
single IOC. To override the hiding, add `-DHIDDEN= ` to your compiler
flags (in this case, the symbols will be exported with their default
visibility).
*/
#ifndef HIDDEN
#if defined(_WIN32) || defined(__CYGWIN__)
#define HIDDEN
#else
#define HIDDEN __attribute__((visibility("hidden")))
#endif
#endif
// macros_H
#endif

View File

@@ -6,25 +6,11 @@
#define DefaultMaxRepetitions 4
#include <asynDriver.h>
#include <macros.h>
#include <string.h>
#include <string>
#include <unordered_map>
/*
The macro "HIDDEN" hides the symbol of the annotated class / function. This is
useful to avoid symbol clashes when loading multiple shared libraries in a
single IOC. To override the hiding, add `-DHIDDEN= ` to your compiler
flags (in this case, the symbols will be exported with their default
visibility).
*/
#ifndef HIDDEN
#if defined(_WIN32) || defined(__CYGWIN__)
#define HIDDEN
#else
#define HIDDEN __attribute__((visibility("hidden")))
#endif
#endif
/**
* @brief Class to identify a message print location. See the docstring of
* `msgPrintControl` on how to use this key.

View File

@@ -9,7 +9,7 @@ Stefan Mathis, November 2024
#ifndef sinqAxis_H
#define sinqAxis_H
#include "asynMotorAxis.h"
#include "msgPrintControl.h"
#include <macros.h>
#include <memory>
#include <type_traits>

View File

@@ -12,6 +12,7 @@ Stefan Mathis, November 2024
#include "asynMotorController.h"
#include "msgPrintControl.h"
#include <initHooks.h>
#include <macros.h>
#include <memory>
#define motorMessageIsFromDriverString "MOTOR_MESSAGE_DRIVER"