Skip to content

Built and used the library on Windows. #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
6 changes: 4 additions & 2 deletions ndsSup/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ include $(TOP)/configure/CONFIG
# ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================

USR_CPPFLAGS=-std=c++0x -Wall -Wextra -pedantic -fPIC -pthread
USR_CPPFLAGS_LINUX=-std=c++0x -Wall -Wextra -pedantic -fPIC -pthread

#==================================================
# build a support library

LIBRARY_IOC += nds3epics

USR_INCLUDES_WIN32 += -I../../../nds3/pthreads4w

# install nds3.dbd into <top>/dbd
DBD += nds3epics.dbd

Expand All @@ -25,7 +27,7 @@ nds3epics_SRCS += ndsRegister.cpp
#INC += nds3/impl/epicsInterfaceImpl.h
#INC += nds3/impl/epicsThread.h

nds3epics_LIBS += nds3
nds3epics_LIBS += nds3 asyn
nds3_DIR = $(NDS3)

nds3epics_LIBS += $(EPICS_BASE_IOC_LIBS)
Expand Down
4 changes: 2 additions & 2 deletions ndsSup/src/epicsFactoryImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#include <iostream>
#include <fstream>
#include <link.h>
#include <elf.h>
#include <dlfcn.h>
#include <set>
#include <string>
#include <sstream>
Expand Down Expand Up @@ -122,6 +120,8 @@ void EpicsFactoryImpl::loadNdsNamingRules(const iocshArgBuf * arguments)
}

std::ifstream iniFile(arguments[0].sval);
if ((iniFile.rdstate() & std::istream::failbit) != 0)
throw std::runtime_error("Invalid INI file");
m_pFactory->loadNamingRules(iniFile);
}
catch(const std::runtime_error& e)
Expand Down
8 changes: 7 additions & 1 deletion ndsSup/src/epicsInterfaceImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,13 @@ void EpicsInterfaceImpl::registrationTerminated()
{
char tmpBuffer[L_tmpnam];

std::string tmpFileName(tmpnam_r(tmpBuffer));
std::string tmpFileName(tmpnam(tmpBuffer));

#ifdef _WIN32
size_t Pos;
while ((Pos = tmpFileName.find('\\')) != std::string::npos)
tmpFileName.replace(Pos, 1, 1, '/');
#endif // _WIN32

std::string fileName(tmpFileName);
std::ofstream outputStream(fileName.c_str());
Expand Down