Skip to content

Commit

Permalink
Merge branch 'upstream-GDCM' into UpdateGDCMForRelease4.13
Browse files Browse the repository at this point in the history
* upstream-GDCM:
  GDCM 2019-11-04 (7e3be76f)
  • Loading branch information
blowekamp committed Nov 5, 2019
2 parents 3213404 + 0353bb4 commit 20f10c2
Show file tree
Hide file tree
Showing 43 changed files with 531 additions and 253 deletions.
2 changes: 1 addition & 1 deletion Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ set(GDCM_PACKAGE_CONTACT "GDCM Developers <[email protected]
#----------------------------------------------------------------------------
set(GDCM_MAJOR_VERSION 2)
set(GDCM_MINOR_VERSION 8)
set(GDCM_BUILD_VERSION 8)
set(GDCM_BUILD_VERSION 10)
set(GDCM_VERSION
"${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}")
# let advanced user the option to define GDCM_API_VERSION:
Expand Down
4 changes: 4 additions & 0 deletions Modules/ThirdParty/GDCM/src/gdcm/Source/Common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ CHECK_FUNCTION_EXISTS(_snprintf GDCM_HAVE__SNPRINTF)
set(CMAKE_REQUIRED_INCLUDES math.h)
set(CMAKE_REQUIRED_LIBRARIES m)
check_function_exists(lround GDCM_HAVE_LROUND)
set(CMAKE_REQUIRED_INCLUDES stdlib.h)
check_function_exists(atoll GDCM_HAVE_ATOLL)
unset(CMAKE_REQUIRED_INCLUDES)
unset(CMAKE_REQUIRED_LIBRARIES)

#include(CheckSymbolExists)
CHECK_FUNCTION_EXISTS(gettimeofday GDCM_HAVE_GETTIMEOFDAY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@ bool CAPICryptographicMessageSyntax::Decrypt(char *output, size_t &outlen, const
BYTE* cek = NULL;
HCRYPTMSG hMsg = NULL;
PCMSG_CMS_RECIPIENT_INFO recipientInfo = NULL;
DWORD dwMessageType, cbMessageTypeLen = sizeof(DWORD);
PCRYPT_ALGORITHM_IDENTIFIER cekAlg = NULL;
ALG_ID kekAlg;
DWORD kekAlgLen = sizeof(ALG_ID);
DWORD nrOfRecipeints, nrOfRecipientsLen = sizeof(DWORD);
BYTE* bareContent = NULL;
struct {
BLOBHEADER header;
Expand All @@ -218,7 +222,6 @@ bool CAPICryptographicMessageSyntax::Decrypt(char *output, size_t &outlen, const
goto err;
}

DWORD dwMessageType, cbMessageTypeLen = sizeof(DWORD);
if(! CryptMsgGetParam(hMsg, CMSG_TYPE_PARAM, 0, &dwMessageType, &cbMessageTypeLen))
{
gdcmErrorMacro( "CryptMsgGetParam CMSG_TYPE_PARAM failed with error 0x" << std::hex << GetLastError() );
Expand All @@ -231,8 +234,6 @@ bool CAPICryptographicMessageSyntax::Decrypt(char *output, size_t &outlen, const
goto err;
}

ALG_ID kekAlg;
DWORD kekAlgLen = sizeof(ALG_ID);
if(! CryptGetKeyParam(hRsaPrivK, KP_ALGID, (BYTE*)&kekAlg, &kekAlgLen, 0))
{
gdcmErrorMacro( "MsgGetParam KP_ALGID failed with error 0x" << std::hex << GetLastError() );
Expand All @@ -244,7 +245,6 @@ bool CAPICryptographicMessageSyntax::Decrypt(char *output, size_t &outlen, const
goto err;
}

DWORD nrOfRecipeints, nrOfRecipientsLen = sizeof(DWORD);
if(! CryptMsgGetParam(hMsg, CMSG_RECIPIENT_COUNT_PARAM, 0, &nrOfRecipeints, &nrOfRecipientsLen))
{
gdcmErrorMacro( "Decode CMSG_RECIPIENT_COUNT_PARAM failed with error 0x" << std::hex << GetLastError() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
#cmakedefine GDCM_HAVE__SNPRINTF
#cmakedefine GDCM_HAVE_LROUND
#cmakedefine GDCM_HAVE_GETTIMEOFDAY
#cmakedefine GDCM_HAVE_ATOLL
#cmakedefine GDCM_HAVE_JSON_OBJECT_OBJECT_GET_EX

// MM: I have a feeling that if GDCM_HAVE_WCHAR_IFSTREAM, then UNICODE filename
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
=========================================================================*/
#include "gdcmCryptoFactory.h"

#ifdef WIN32
#ifdef _WIN32
#include "gdcmCAPICryptoFactory.h"
#endif

Expand All @@ -29,7 +29,7 @@ namespace gdcm

CryptoFactory* CryptoFactory::GetFactoryInstance(CryptoLib id)
{
#ifdef WIN32
#ifdef _WIN32
static CAPICryptoFactory capi(CryptoFactory::CAPI);
#endif
#ifdef GDCM_USE_SYSTEM_OPENSSL
Expand All @@ -50,9 +50,9 @@ CryptoFactory* CryptoFactory::GetFactoryInstance(CryptoLib id)
#endif // GDCM_HAVE_CMS_RECIPIENT_PASSWORD
#endif // GDCM_USE_SYSTEM_OPENSSL
// We always prefer native API (by default):
#ifdef WIN32
#ifdef _WIN32
id = CryptoFactory::CAPI;
#endif // WIN32
#endif // _WIN32
}

std::map<CryptoLib, CryptoFactory*>::iterator it = getInstanceMap().find(id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ unsigned int Directory::Load(FilenameType const &name, bool recursive)
Toplevel = name;
return Explore( Toplevel, recursive );
}
return false;
return 0;
}

unsigned int Directory::Explore(FilenameType const &name, bool recursive)
Expand Down
4 changes: 2 additions & 2 deletions Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmSystem.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ bool System::MakeDirectory(const char *path)
bool ok = true;
while(ok && (pos = dir.find('/', pos)) != std::string::npos)
{
topdir = dir.substr(0, pos);
ok = ok && Mkdir(topdir.c_str());
topdir = dir.substr(0, pos+1);
ok = ok && (System::FileIsDirectory(topdir.c_str()) || 0 == Mkdir(topdir.c_str()));
pos++;
}
if( !ok ) return false;
Expand Down
12 changes: 6 additions & 6 deletions Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmTerminal.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <iostream>
#include <fstream>

#ifdef WIN32
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h> /* SetConsoleTextAttribute */
#endif
Expand All @@ -40,7 +40,7 @@ class ConsoleImp
{
private:
// console implementation details:
#ifdef WIN32
#ifdef _WIN32
HANDLE hConsoleHandle;
CONSOLE_SCREEN_BUFFER_INFO ConsoleInfo;
WORD wNormalAttributes;
Expand All @@ -52,7 +52,7 @@ class ConsoleImp
public:
ConsoleImp()
{
#ifdef WIN32
#ifdef _WIN32
hConsoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hConsoleHandle, &ConsoleInfo);
wNormalAttributes = ConsoleInfo.wAttributes;
Expand All @@ -61,7 +61,7 @@ class ConsoleImp
}
~ConsoleImp()
{
#ifdef WIN32
#ifdef _WIN32
SetConsoleTextAttribute(hConsoleHandle, wNormalAttributes);
}
WORD get_attributes() {
Expand All @@ -85,7 +85,7 @@ class ConsoleImp
return command;
}
void set_attributes(int color) {
#ifdef WIN32
#ifdef _WIN32
static const int colors[8] = { 0, 4, 2, 6, 1, 5, 3, 7 };
WORD wAttributes;

Expand Down Expand Up @@ -154,7 +154,7 @@ class ConsoleImp
SetConsoleTextAttribute(hConsoleHandle, wAttributes);
#else
(void)color;
#endif //WIN32
#endif //_WIN32
}

};
Expand Down
2 changes: 1 addition & 1 deletion Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmWin32.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#endif
//-----------------------------------------------------------------------------
// http://gcc.gnu.org/wiki/Visibility
#if defined(WIN32) && defined(GDCM_BUILD_SHARED_LIBS)
#if defined(_WIN32) && defined(GDCM_BUILD_SHARED_LIBS)
#if (defined(gdcmCommon_EXPORTS) || defined(gdcmDICT_EXPORTS) || defined(gdcmDSED_EXPORTS) || defined(gdcmIOD_EXPORTS) || defined(gdcmMSFF_EXPORTS) || defined(gdcmMEXD_EXPORTS)|| defined(_gdcmswig_EXPORTS)) || defined(vtkgdcm_EXPORTS)
#define GDCM_EXPORT __declspec( dllexport )
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ zran.c

#include <gdcm_zlib.h>

#ifdef WIN32 /* Window 95 & Windows NT */
#ifdef _WIN32 /* Window 95 & Windows NT */
# define OS_CODE 0x0b
#endif
#if defined(MACOS) || defined(TARGET_OS_MAC)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#include "gdcmDict.h"
#include "gdcmDictEntry.h"

namespace gdcm {
namespace {
using namespace gdcm;
typedef struct
{
uint16_t group;
Expand Down Expand Up @@ -13275,6 +13276,9 @@ static const DICT_ENTRY DICOMV3DataDict [] = {
{0xffff,0xffff,VR::INVALID,VM::VM0,"","",true }, // dummy
{0xffff,0xffff,VR::INVALID,VM::VM0,0,0,true } // Gard
};
} // end anonymous namespace

namespace gdcm {

void Dict::LoadDefault()
{
Expand Down
Loading

0 comments on commit 20f10c2

Please sign in to comment.