forked from epics_driver_modules/require
changes for 3.15.5
This commit is contained in:
+2
-2
@@ -8,8 +8,8 @@ extern "C" {
|
||||
#define __attribute__(arg)
|
||||
#endif
|
||||
|
||||
int asprintf(char** pbuffer, const char* format, ...) __attribute__((format(printf,2,3)));
|
||||
int vasprintf(char** pbuffer, const char* format, va_list ap) __attribute__((format(printf,2,0)));
|
||||
int asprintf(char** pbuffer, const char* format, ...) __attribute__((__format__(__printf__,2,3)));
|
||||
int vasprintf(char** pbuffer, const char* format, va_list ap) __attribute__((__format__(__printf__,2,0)));
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -128,9 +128,9 @@ else
|
||||
BASE=$(basename $(rp $EPICS_BASE))
|
||||
BASE=${BASE#*base-}
|
||||
fi
|
||||
if [ "${BASE#3.14.}" = "$BASE" -a "${BASE#3.15.}" = "$BASE" ]
|
||||
if [ "${BASE#3.}" = "$BASE" ]
|
||||
then
|
||||
echo "Cannot find any EPICS 3.14 or 3.15 version" >&2
|
||||
echo "Cannot find any EPICS base version" >&2
|
||||
echo "Try setting EPICS_BASE environment variable to full path" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -442,6 +442,7 @@ static int setupDbPath(const char* module, const char* dbdir)
|
||||
static int getRecordHandle(const char* namepart, short type, long minsize, DBADDR* paddr)
|
||||
{
|
||||
char recordname[PVNAME_STRINGSZ];
|
||||
long dummy, offset;
|
||||
|
||||
sprintf(recordname, "%.*s%s", (int)(PVNAME_STRINGSZ-strlen(namepart)-1), getenv("IOC"), namepart);
|
||||
if (dbNameToAddr(recordname, paddr) != 0)
|
||||
@@ -468,6 +469,8 @@ static int getRecordHandle(const char* namepart, short type, long minsize, DBADD
|
||||
recordname);
|
||||
return -1;
|
||||
}
|
||||
/* update array information */
|
||||
dbGetRset(paddr)->get_array_info(paddr, &dummy, &offset);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -665,7 +668,9 @@ static int findLibRelease (
|
||||
char* version;
|
||||
char* symname;
|
||||
char name[NAME_MAX + 11]; /* get space for library path + "LibRelease" */
|
||||
|
||||
|
||||
(void)data; /* unused */
|
||||
if (size < sizeof(struct dl_phdr_info)) return 0; /* wrong version of struct dl_phdr_info */
|
||||
/* find a symbol with a name like "_<module>LibRelease"
|
||||
where <module> is from the library name "<location>/lib<module>.so" */
|
||||
if (info->dlpi_name == NULL || info->dlpi_name[0] == 0) return 0; /* no library name */
|
||||
@@ -1171,7 +1176,7 @@ static int handleDependencies(const char* module, char* depfilename)
|
||||
while (*end && !isspace((unsigned char)*end)) end++;
|
||||
|
||||
/* add + to numerial versions if not yet there */
|
||||
if (*(end-1) != '+' && strspn(rversion, "0123456789.") == end-rversion) *end++ = '+';
|
||||
if (*(end-1) != '+' && strspn(rversion, "0123456789.") == (size_t)(end-rversion)) *end++ = '+';
|
||||
|
||||
/* terminate version */
|
||||
*end = 0;
|
||||
|
||||
@@ -15,7 +15,7 @@ const char* getLibVersion(const char* libname);
|
||||
const char* getLibLocation(const char* libname);
|
||||
int libversionShow(const char* outfile);
|
||||
int runScript(const char* filename, const char* args);
|
||||
int putenvprintf(const char* format, ...) __attribute__((format(printf,1,2)));
|
||||
int putenvprintf(const char* format, ...) __attribute__((__format__(__printf__,1,2)));
|
||||
void pathAdd(const char* varname, const char* dirname);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
+15
-8
@@ -1,4 +1,6 @@
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
@@ -10,6 +12,8 @@
|
||||
#include <initHooks.h>
|
||||
#include <epicsVersion.h>
|
||||
|
||||
#define EPICSVER EPICS_VERSION*10000+EPICS_REVISION*100+EPICS_MODIFICATION
|
||||
|
||||
#ifdef vxWorks
|
||||
#include "asprintf.h"
|
||||
#include <sysSymTbl.h>
|
||||
@@ -28,8 +32,7 @@
|
||||
#include "asprintf.h"
|
||||
#endif
|
||||
|
||||
#ifdef BASE_VERSION
|
||||
#define EPICS_3_13
|
||||
#if (EPICSVER<31400)
|
||||
extern char** ppGlobalEnviron;
|
||||
#define OSI_PATH_SEPARATOR "/"
|
||||
#define OSI_PATH_LIST_SEPARATOR ":"
|
||||
@@ -124,7 +127,7 @@ const char* getFormat(const char** pp)
|
||||
{
|
||||
static char format [20];
|
||||
const char* p = *pp;
|
||||
int i = 1;
|
||||
unsigned int i = 1;
|
||||
if (runScriptDebug > 1) printf ("getFormat %s\n", p);
|
||||
if ((format[0] = *p++) == '%')
|
||||
{
|
||||
@@ -166,9 +169,13 @@ int runScript(const char* filename, const char* args)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (macCreateHandle(&mac,(char*[]){ "", "environ", NULL, NULL }) != 0) goto error;
|
||||
if (macCreateHandle(&mac,(
|
||||
#if (EPICSVER>=31501)
|
||||
const
|
||||
#endif
|
||||
char*[]){ "", "environ", NULL, NULL }) != 0) goto error;
|
||||
macSuppressWarning(mac, 1);
|
||||
#ifdef EPICS_3_13
|
||||
#if (EPICSVER<31400)
|
||||
/* Have no environment macro substitution, thus load envionment explicitly */
|
||||
/* Actually, environmant macro substitution was introduced in 3.14.3 */
|
||||
for (pairs = ppGlobalEnviron; *pairs; pairs++)
|
||||
@@ -194,7 +201,7 @@ int runScript(const char* filename, const char* args)
|
||||
|
||||
#ifdef vxWorks
|
||||
/* expand macros (environment variables) in file name because vxWorks shell can't do it */
|
||||
#ifdef EPICS_3_13
|
||||
#if (EPICSVER<31400)
|
||||
/* 3.13 version of macExpandString is broken and may write more than allowed */
|
||||
while ((len = labs(macExpandString(mac, (char*)filename, line_exp,
|
||||
line_exp_size/2))) >= line_exp_size/2)
|
||||
@@ -272,7 +279,7 @@ int runScript(const char* filename, const char* args)
|
||||
printf("runScript raw line (%ld chars): '%s'\n", len, line_raw);
|
||||
/* expand and check the buffer size (different epics versions write different may number of bytes)*/
|
||||
while ((len = labs(macExpandString(mac, line_raw, line_exp,
|
||||
#ifdef EPICS_3_13
|
||||
#if (EPICSVER<31400)
|
||||
/* 3.13 version of macExpandString is broken and may write more than allowed */
|
||||
line_exp_size/2))) >= line_exp_size/2)
|
||||
#else
|
||||
@@ -401,7 +408,7 @@ end:
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifndef EPICS_3_13
|
||||
#if (EPICSVER>=31400)
|
||||
/* initHooks is not included in iocCore in 3.13 */
|
||||
|
||||
struct cmditem
|
||||
|
||||
Reference in New Issue
Block a user