use NELEMENTS instead of registryFunction.h
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include <dbDefs.h>
|
||||
#include <registryFunction.h>
|
||||
#include <subRecord.h>
|
||||
#define epicsExportSharedSymbols
|
||||
@@ -28,6 +29,6 @@ static registryFunctionRef mySubRef[] = {
|
||||
|
||||
epicsShareFunc void epicsShareAPI mySub(void)
|
||||
{
|
||||
registryFunctionRefAdd(mySubRef,registryFunctionRefNumber(mySubRef));
|
||||
registryFunctionRefAdd(mySubRef,NELEMENTS(mySubRef));
|
||||
}
|
||||
|
||||
|
||||
@@ -19,11 +19,9 @@ extern "C" {
|
||||
typedef void (*REGISTRYFUNCTION)(void);
|
||||
|
||||
typedef struct registryFunctionRef {
|
||||
char *name;
|
||||
const char *name;
|
||||
REGISTRYFUNCTION addr;
|
||||
}registryFunctionRef;
|
||||
#define registryFunctionRefNumber(functionRefArray) \
|
||||
(sizeof((functionRefArray))/sizeof(registryFunctionRef))
|
||||
|
||||
/* c interface definitions */
|
||||
epicsShareFunc int epicsShareAPI registryFunctionAdd(
|
||||
|
||||
Reference in New Issue
Block a user