EPICS Base 7.0.8.0
Loading...
Searching...
No Matches
epicsExport.h
Go to the documentation of this file.
1/*************************************************************************\
2* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
3* National Laboratory.
4* Copyright (c) 2002 The Regents of the University of California, as
5* Operator of Los Alamos National Laboratory.
6* SPDX-License-Identifier: EPICS
7* EPICS Base is distributed subject to a Software License Agreement found
8* in file LICENSE that is included with this distribution.
9\*************************************************************************/
10
11#ifndef INC_epicsExport_H
12#define INC_epicsExport_H
13
35#define epicsExportSharedSymbols
36#include <shareLib.h>
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42typedef void (*REGISTRAR)(void);
43
44#define EPICS_EXPORT_POBJ(typ, obj) pvar_ ## typ ## _ ## obj
45#define EPICS_EXPORT_PFUNC(fun) EPICS_EXPORT_POBJ(func, fun)
46
81#define epicsExportAddress(typ, obj) \
82 epicsShareExtern typ *EPICS_EXPORT_POBJ(typ,obj); \
83 epicsShareDef typ *EPICS_EXPORT_POBJ(typ, obj) = (typ *) (char *) &obj
84
100#define epicsExportRegistrar(fun) \
101 epicsShareFunc REGISTRAR EPICS_EXPORT_PFUNC(fun) = (REGISTRAR) &fun
102
117#define epicsRegisterFunction(fun) \
118 static void register_func_ ## fun(void) \
119 { \
120 registryFunctionAdd(#fun, (REGISTRYFUNCTION) fun); \
121 } \
122 epicsExportRegistrar(register_func_ ## fun)
123
124#ifdef __cplusplus
125}
126#endif
127
128#endif /* INC_epicsExport_H */
Mark external symbols and entry points for shared libraries.