From 3471a0c41b7c95b1855e27b4e28c74bac75058f9 Mon Sep 17 00:00:00 2001 From: zimoch Date: Thu, 13 Jun 2013 14:36:54 +0000 Subject: [PATCH] fixes for old vxWorks and Win32 --- require.c | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/require.c b/require.c index 29b92fa..d4b7fa7 100644 --- a/require.c +++ b/require.c @@ -3,7 +3,7 @@ * * $Author: zimoch $ * $ID$ -* $Date: 2012/11/07 10:17:28 $ +* $Date: 2013/06/13 14:36:54 $ * * DISCLAIMER: Use at your own risc and so on. No warranty, no refund. */ @@ -22,7 +22,7 @@ extern volatile int interruptAccept; #define EPICS_3_14 #include #include -extern int iocshCmd (const char *cmd); +epicsShareFunc int epicsShareAPI iocshCmd (const char *cmd); #include #include #endif @@ -38,7 +38,7 @@ static int firstTime = 1; #define PREFIX #define INFIX -#if defined (__vxworks) +#if defined (vxWorks) #include #include @@ -91,7 +91,8 @@ static int firstTime = 1; #define getAddress(module,name) (GetProcAddress(module, name)) #else - #error unknwn OS + #warning unknwn OS + #define getAddress(module,name) NULL #endif @@ -132,7 +133,7 @@ static HMODULE loadlib(const char* libname) libname, lpMsgBuf); LocalFree(lpMsgBuf); } -#elif defined (__vxworks) +#elif defined (vxWorks) { int fd, loaderror; fd = open(libname, O_RDONLY, 0); @@ -185,7 +186,7 @@ static void registerModule(const char* module, const char* version) } } -#if defined (__vxworks) +#if defined (vxWorks) BOOL findLibRelease ( char *name, /* symbol name */ int val, /* value of symbol */ @@ -249,6 +250,19 @@ static void registerExternalModules() dl_iterate_phdr(findLibRelease, NULL); } +#elif defined (_WIN32) + +static void registerExternalModules() +{ + ; +} + + +#else +static void registerExternalModules() +{ + ; +} #endif @@ -345,7 +359,7 @@ int require(const char* module, const char* ver) { /* require failed in startup script before iocInit */ fprintf(stderr, "Aborting startup script\n"); -#ifdef __vxworks +#ifdef vxWorks shellScriptAbort(); #else epicsExit(1); @@ -384,7 +398,7 @@ static int require_priv(const char* module, const char* vers) return -1; } - bzero(version, sizeof(version)); + memset(version, 0, sizeof(version)); if (vers) strncpy(version, vers, sizeof(version)); loaded = getLibVersion(module); @@ -468,7 +482,7 @@ static int require_priv(const char* module, const char* vers) if (requireDebug) printf("require: looking for %s\n", fulllibname); if (stat(fulllibname, &filestat) == 0) break; -#ifdef __vxworks +#ifdef vxWorks /* now without the .munch */ fulllibname[strlen(fulllibname)-6] = 0; if (requireDebug) @@ -609,7 +623,7 @@ static int require_priv(const char* module, const char* vers) #ifdef EPICS_3_14 sprintf (symbolname, "%s_registerRecordDeviceDriver", module); printf ("Calling %s function\n", symbolname); -#ifdef __vxworks +#ifdef vxWorks { FUNCPTR f = (FUNCPTR) getAddress(NULL, symbolname); if (f)