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
2 changes: 1 addition & 1 deletion CMake/dcmtkAfterModules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if(BUILD_SINGLE_SHARED_LIBRARY)
# Build a single "everything-library".
# The library dependencies are collected by DCMTK_TARGET_LINK_LIBRARIES().
add_library(dcmtk SHARED ${LIBS})
target_link_libraries(dcmtk ${DCMTK_LIBRARY_DEPENDENCIES})
target_link_libraries(dcmtk PRIVATE ${DCMTK_LIBRARY_DEPENDENCIES})
set_target_properties(dcmtk PROPERTIES ${DCMTK_LIBRARY_PROPERTIES})

# Export target for build tree
Expand Down
6 changes: 3 additions & 3 deletions ofstd/include/dcmtk/ofstd/ofcond.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class DCMTK_OFSTD_EXPORT OFCondition
theCondition.theStatus = aStatus;
/* Be nice when someone dares to pass in NULL */
if (aText != NULL) {
theCondition.theText = strdup(aText);
theCondition.theText = _strdup(aText);
ownsText = OFTrue;
} else {
theCondition.theText = "";
Expand All @@ -220,7 +220,7 @@ class DCMTK_OFSTD_EXPORT OFCondition
// Do we need our own copy of the text?
if (ownsText)
{
theCondition.theText = strdup(theCondition.theText);
theCondition.theText = _strdup(theCondition.theText);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't _strdup specific for the MS compiler, and strdup is the POSIX standard?

}
}

Expand Down Expand Up @@ -256,7 +256,7 @@ class DCMTK_OFSTD_EXPORT OFCondition
ownsText = arg.ownsText;
if (ownsText)
{
theCondition.theText = strdup(arg.theCondition.theText);
theCondition.theText = _strdup(arg.theCondition.theText);
}
}
return *this;
Expand Down
8 changes: 4 additions & 4 deletions ofstd/libsrc/offile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ OFFilename::OFFilename(const OFFilename &arg)
#endif
{
if (arg.filename_ != NULL)
filename_ = strdup(arg.filename_);
filename_ = _strdup(arg.filename_);
#if (defined(WIDE_CHAR_FILE_IO_FUNCTIONS) || defined(WIDE_CHAR_MAIN_FUNCTION)) && defined(_WIN32)
if (arg.wfilename_ != NULL)
wfilename_ = _wcsdup(arg.wfilename_);
Expand All @@ -118,7 +118,7 @@ OFFilename &OFFilename::operator=(const OFFilename &arg)
if (&arg != this)
{
free(filename_);
filename_ = (arg.filename_ != NULL) ? strdup(arg.filename_) : NULL;
filename_ = (arg.filename_ != NULL) ? _strdup(arg.filename_) : NULL;
#if (defined(WIDE_CHAR_FILE_IO_FUNCTIONS) || defined(WIDE_CHAR_MAIN_FUNCTION)) && defined(_WIN32)
free(wfilename_);
wfilename_ = (arg.wfilename_ != NULL) ? _wcsdup(arg.wfilename_) : NULL;
Expand Down Expand Up @@ -165,7 +165,7 @@ void OFFilename::set(const char *filename,
clear();
if (filename != NULL)
{
filename_ = strdup(filename);
filename_ = _strdup(filename);
#if (defined(WIDE_CHAR_FILE_IO_FUNCTIONS) || defined(WIDE_CHAR_MAIN_FUNCTION)) && defined(_WIN32)
#ifdef HAVE_WINDOWS_H
if (convert)
Expand Down Expand Up @@ -215,7 +215,7 @@ void OFFilename::set(const wchar_t *filename,
/* convert wide character encoding to UTF-8 representation */
OFCharacterEncoding::convertFromWideCharString(filename, wcslen(filename),
tmpString, OFCharacterEncoding::CPC_UTF8);
filename_ = strdup(tmpString.c_str());
filename_ = _strdup(tmpString.c_str());
}
#endif
/* avoid compiler warning on unused variable */
Expand Down