Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions 3rdPartyLibs/cint_platform_Ubuntu_gcc4_so
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
############################################################
# platform/linux_RH7.3_gcc4_so
# Platform dependent information for LINUX 2.0 RedHatH6.2 or later
# using gcc-4.1.2
# Build libcint.so instead of G__ci.a. And creates multi-thread safe DLLs.
# Based on Christoph Bugel's proposal about multi-threading.
############################################################

# Tools
RM = rm -f
CP = cp
AR = ar
AROPT = clq
KRCC = gcc -traditional
CC = gcc -fexceptions -Wall
CPP = g++ -Wall
LD = g++
CPREP = gcc -E -C
CPPPREP = g++ -E -C

# Compiler and linker option
CCDLLOPT = -fPIC
LDDLLOPT = -shared -lpthread
OPTIMIZE = -O3
LDOPT = -lm -ldl -lncurses -lpthread
SHLIB_OPT = -Wl,-hlibcint.so
SYSMACRO = -DG__REGEXP -DG__SHAREDLIB -DG__OSFDLL -DG__ANSI -DG__ERRORCALLBACK -DG__NEWSTDHEADER
OTHMACRO = -DG__P2FCAST -DG__REDIRECTIO -DG__DETECT_NEWDEL -DG__POSIX -DG__STD_EXCEPTION $(CCDLLPOST)
SYSIPATH =

# libraries
MAINO = $(CINTSYSDIR)/main/G__cppmain.o
CINTLIB = $(CINTSYSDIR)/libcint.so
READLINEA = /usr/lib/i386-linux-gnu/libreadline.so
APIO = Api.o Class.o BaseCls.o Type.o DataMbr.o Method.o MethodAr.o CallFunc.o Typedf.o Apiif.o Token.o
RANLIB = /usr/bin/ranlib
STDLIBS = dmystrm.o stdstrct.o
PLATFORM = $(CINTSYSDIR)/main/G__setup.o

# source code postfix
CSRCPOST = .c
CHDRPOST = .h
CPPSRCPOST = .C
CPPHDRPOST = .h
OBJPOST = .o
DLLPOST = .dl



31 changes: 20 additions & 11 deletions BaseLib2/Level0/Directory.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class DirectoryEntry: public LinkedListable{
#if (defined (_VXWORKS) || defined(_RTAI) || defined(_LINUX) || (defined _SOLARIS) || defined(_MACOSX))
/** attributes of the file */
struct stat fileStatistics;
int fileStatisticsErr;
#elif defined(_WIN32)
/** all the data about the file or directory */
WIN32_FIND_DATA fileData;
Expand Down Expand Up @@ -97,7 +98,7 @@ class DirectoryEntry: public LinkedListable{
/** is it a directory */
bool IsDirectory(){
#if (defined (_VXWORKS)||defined(_RTAI)|| defined(_LINUX) || defined(_SOLARIS) || defined(_MACOSX))
return S_ISDIR(fileStatistics.st_mode);
return (fileStatisticsErr == 0 && S_ISDIR(fileStatistics.st_mode));
#elif defined(_WIN32)
return ((fileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)!=0);
#else
Expand All @@ -108,7 +109,7 @@ class DirectoryEntry: public LinkedListable{
/** is it a file */
bool IsFile(){
#if (defined (_VXWORKS)||defined(_RTAI)|| defined(_LINUX) || defined(_SOLARIS) || defined(_MACOSX))
return S_ISREG(fileStatistics.st_mode);
return (fileStatisticsErr == 0 && S_ISREG(fileStatistics.st_mode));
#else
return IsDirectory() == False;
#endif
Expand All @@ -129,7 +130,10 @@ class DirectoryEntry: public LinkedListable{
/** the file size */
int64 Size(){
#if (defined (_VXWORKS)||defined(_RTAI)|| defined(_LINUX) || defined(_SOLARIS) || defined(_MACOSX))
return fileStatistics.st_size;
// st_size is of type "off_t" which the standard specifies "shall be signed integer type."
// We will return 0 as the size when stat(...) has returned an error, because the size
// is still used to calculate total size of files in a LinkedListHolder
return (fileStatisticsErr == 0 ? fileStatistics.st_size : (off_t)(0));
#elif defined(_WIN32)
uint64 sz = fileData.nFileSizeHigh;
sz <<= 32;
Expand All @@ -143,7 +147,8 @@ class DirectoryEntry: public LinkedListable{
/** last write time */
time_t Time(){
#if (defined (_VXWORKS)||defined(_RTAI)|| defined(_LINUX) || defined(_SOLARIS) || defined(_MACOSX))
return fileStatistics.st_mtime;
// time( time_t *arg ) returns a time_t with value of -1 for an error, so we will do the same
return (fileStatisticsErr == 0 ? fileStatistics.st_mtime : (time_t)(-1));
#elif defined(_WIN32)
uint64 t = *((uint64 *)&fileData.ftLastWriteTime);
uint64 t2;
Expand All @@ -160,7 +165,8 @@ class DirectoryEntry: public LinkedListable{
/** last access time */
time_t LastAccessTime(){
#if (defined (_VXWORKS)||defined(_RTAI)|| defined(_LINUX) || defined(_SOLARIS) || defined(_MACOSX))
return fileStatistics.st_atime;
// time( time_t *arg ) returns a time_t with value of -1 for an error, so we will do the same
return (fileStatisticsErr == 0 ? fileStatistics.st_atime : (time_t)(-1));
#elif defined(_WIN32)
uint64 t = *((uint64 *)&fileData.ftLastAccessTime);
uint64 t2;
Expand Down Expand Up @@ -231,7 +237,7 @@ class Directory: public LinkedListHolder {
strcat(statAddr, "/");

strcat(statAddr, entry->fname);
stat(statAddr,&entry->fileStatistics);
entry->fileStatisticsErr = stat(statAddr,&entry->fileStatistics);
size += entry->Size();
}
free((void *&)de);
Expand Down Expand Up @@ -263,7 +269,7 @@ class Directory: public LinkedListHolder {
strcat(statAddr, "/");

strcat(statAddr, entry->fname);
stat(statAddr,&entry->fileStatistics);
entry->fileStatisticsErr = stat(statAddr,&entry->fileStatistics);
size += entry->Size();
}
}
Expand Down Expand Up @@ -298,7 +304,7 @@ class Directory: public LinkedListHolder {
strcat(statAddr, "/");

strcat(statAddr, entry->fname);
stat(statAddr,&entry->fileStatistics);
&entry->fileStatisticsErr = stat(statAddr,&entry->fileStatistics);
size += entry->Size();
}
closedir(d);
Expand All @@ -320,7 +326,7 @@ class Directory: public LinkedListHolder {
strcat(statAddr, "/");

strcat(statAddr, entry->fname);
stat(statAddr,&entry->fileStatistics);
&entry->fileStatisticsErr = stat(statAddr,&entry->fileStatistics);
size += entry->Size();
}
closedir(d);
Expand Down Expand Up @@ -432,8 +438,11 @@ class Directory: public LinkedListHolder {
return (attrs & FILE_ATTRIBUTE_DIRECTORY);
#elif (defined(_LINUX) || defined(_MACOSX))
struct stat fileStats;
stat(address, &fileStats);
return S_ISDIR(fileStats.st_mode);
if (stat(address, &fileStats) == 0) {
return S_ISDIR(fileStats.st_mode);
} else {
return False;
}
#else
// NOT IMPLEMENTED
return False;
Expand Down
6 changes: 5 additions & 1 deletion BaseLib2/Level0/LoadableLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#define LOADABLE_LIBRARY_H

#include "System.h"
#include "ErrorManagement.h"

#if defined _VXWORKS
/** */
Expand Down Expand Up @@ -125,7 +126,10 @@ class LoadableLibrary{
if (module != 0) Close();

module = dlopen(dllName, RTLD_NOW|RTLD_GLOBAL);
if (module==NULL) return False;
if (module==NULL) {
CStaticAssertErrorCondition(Information,"LoadableLibrary: %s", dlerror());
return False;
}
return True;
#elif (defined (_WIN32) || defined(_RSXNT))
if (dllName == NULL) return False;
Expand Down
2 changes: 1 addition & 1 deletion BaseLib2/Level0/StaticListTemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class StaticListTemplate:protected StaticListHolder {

/** Add a the top */
inline void ListInsert(const T &element){
return StaticListHolder::ListAdd((const intptr *)&element,SLH_StartOfList);
StaticListHolder::ListAdd((const intptr *)&element,SLH_StartOfList);
}

/** removes at the specified position */
Expand Down
10 changes: 9 additions & 1 deletion BaseLib2/Level0/Threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,15 @@ TID ThreadsBeginThread(ThreadFunctionType function,
pthread_attr_init(&stackSizeAttribute);
pthread_attr_setstacksize(&stackSizeAttribute, stacksize);
StandardThreadFunction Function = (StandardThreadFunction)SystemThreadFunction;
pthread_create(&ID, &stackSizeAttribute, Function, tii);
int threadCreationReturn = pthread_create(&ID, &stackSizeAttribute, Function, tii);
if (threadCreationReturn != 0) {
if (threadCreationReturn == 11) {
CStaticAssertErrorCondition(FatalError,"Threads::BeginThread (%s) pthread_create failed with error number 11! Usually 11=EAGAIN, no memory or too many threads. Check `ulimit -a`",name);
} else {
CStaticAssertErrorCondition(FatalError,"Threads::BeginThread (%s) pthread_create failed with error number %d! ",name);
}
return 0;
}
pthread_detach(ID);
pthread_setaffinity_np(ID, sizeof(runOnCPUs.processorMask), (cpu_set_t *)&runOnCPUs.processorMask);
#elif (defined _SOLARIS || defined(_MACOSX)) && (defined USE_PTHREAD)
Expand Down
29 changes: 16 additions & 13 deletions BaseLib2/Level1/ObjectRegistryDataBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ class ObjectRegistryDataBase : private LinkedListHolder{
char dllName_[maxSize];
const char *dllName;

// check for empty className
if (className[0] == 0) return NULL;

// check for dllName::className syntax
if (hasDllName){
int size = hasDllName-className;
Expand Down Expand Up @@ -204,34 +207,34 @@ class ObjectRegistryDataBase : private LinkedListHolder{
// ret = ll->Open(fullName);
// }

// GENERAL APPLICATION MODULE
if (!ret) {
sprintf(fullName,"%s.gam",dllName);
ret = ll->Open(fullName);
}
// HIGH LEVEL DRIVER (GENERAL ACQUISITION MODULE)
if (!ret) {
sprintf(fullName,"%s.drv",dllName);
ret = ll->Open(fullName);
}
#if defined(_MACOSX)
// MAC OS X NAME FOR DLL
if (!ret) {
sprintf(fullName,"%s.dylib",dllName);
ret = ll->Open(fullName);
}
#else
// LINUX NAME FOR DLL
if (!ret) {
sprintf(fullName,"%s.so",dllName);
ret = ll->Open(fullName);
}
// STD NAME FOR DLL
if (!ret) {
sprintf(fullName,"%s.dll",dllName);
ret = ll->Open(fullName);
}
// LINUX NAME FOR DLL
#endif
// GENERAL APPLICATION MODULE
if (!ret) {
sprintf(fullName,"%s.so",dllName);
sprintf(fullName,"%s.gam",dllName);
ret = ll->Open(fullName);
}
// HIGH LEVEL DRIVER (GENERAL ACQUISITION MODULE)
if (!ret) {
sprintf(fullName,"%s.drv",dllName);
ret = ll->Open(fullName);
}
#endif

free((void *&)fullName);
if (!ret) return NULL;
Expand Down
3 changes: 3 additions & 0 deletions BaseLib2/Level6/WaveformInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#define WAVEFORMINTERFACE_H_

#include "System.h"
#include "GAM.h"

class WaveformInterface {
public:
Expand All @@ -51,6 +52,8 @@ class WaveformInterface {
return (double)GetValue((int32)usecTime);
}

inline virtual void SetState(GAM_FunctionNumbers state) {}

virtual void Reset() = 0;
};

Expand Down
3 changes: 3 additions & 0 deletions GAMs/DataCollectionGAM/DataCollectionGAM.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ OBJECT_DLL_STUFF(DataCollectionGAM)
* @return False on error, True otherwise.
*/
virtual bool ProcessHttpMessage(HttpStream &hStream);


int GetTotalSamplesCollected();
};

#endif
1 change: 1 addition & 0 deletions GAMs/ExpEval/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ all: $(OBJS) $(SUBPROJ)\
$(TARGET)/ExpEvalGAM$(GAMEXT)
echo $(OBJS)

include depends.$(TARGET)
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)

1 change: 1 addition & 0 deletions GAMs/ExpEval/Module/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ all: $(OBJS) \
$(TARGET)/ExpEval$(DLLEXT)
echo $(OBJS)

include depends.$(TARGET)
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)

74 changes: 0 additions & 74 deletions GAMs/PIDGAM/PIDGAMClassInfo.sinfo.cpp

This file was deleted.

Loading