Skip to content

Commit 0353bb4

Browse files
GDCM Upstreamblowekamp
authored andcommitted
GDCM 2019-11-04 (7e3be76f)
Code extracted from: http://git.code.sf.net/p/gdcm/gdcm.git at commit 7e3be76f17521d4124eb97ca0cddcda5f4c623bb (release-2-8). Change-Id: I628ac600eb31b13f35effd609a7dd0bdebe5c005
1 parent 70ca4da commit 0353bb4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+564
-255
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ set(GDCM_PACKAGE_CONTACT "GDCM Developers <gdcm-developers@lists.sourceforge.net
4343
#----------------------------------------------------------------------------
4444
set(GDCM_MAJOR_VERSION 2)
4545
set(GDCM_MINOR_VERSION 8)
46-
set(GDCM_BUILD_VERSION 8)
46+
set(GDCM_BUILD_VERSION 10)
4747
set(GDCM_VERSION
4848
"${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}")
4949
# let advanced user the option to define GDCM_API_VERSION:

Source/Common/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ CHECK_FUNCTION_EXISTS(_snprintf GDCM_HAVE__SNPRINTF)
5151
set(CMAKE_REQUIRED_INCLUDES math.h)
5252
set(CMAKE_REQUIRED_LIBRARIES m)
5353
check_function_exists(lround GDCM_HAVE_LROUND)
54+
set(CMAKE_REQUIRED_INCLUDES stdlib.h)
55+
check_function_exists(atoll GDCM_HAVE_ATOLL)
56+
unset(CMAKE_REQUIRED_INCLUDES)
57+
unset(CMAKE_REQUIRED_LIBRARIES)
5458

5559
#include(CheckSymbolExists)
5660
CHECK_FUNCTION_EXISTS(gettimeofday GDCM_HAVE_GETTIMEOFDAY)

Source/Common/gdcmCAPICryptographicMessageSyntax.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,11 @@ bool CAPICryptographicMessageSyntax::Decrypt(char *output, size_t &outlen, const
192192
BYTE* cek = NULL;
193193
HCRYPTMSG hMsg = NULL;
194194
PCMSG_CMS_RECIPIENT_INFO recipientInfo = NULL;
195+
DWORD dwMessageType, cbMessageTypeLen = sizeof(DWORD);
195196
PCRYPT_ALGORITHM_IDENTIFIER cekAlg = NULL;
197+
ALG_ID kekAlg;
198+
DWORD kekAlgLen = sizeof(ALG_ID);
199+
DWORD nrOfRecipeints, nrOfRecipientsLen = sizeof(DWORD);
196200
BYTE* bareContent = NULL;
197201
struct {
198202
BLOBHEADER header;
@@ -218,7 +222,6 @@ bool CAPICryptographicMessageSyntax::Decrypt(char *output, size_t &outlen, const
218222
goto err;
219223
}
220224

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

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

247-
DWORD nrOfRecipeints, nrOfRecipientsLen = sizeof(DWORD);
248248
if(! CryptMsgGetParam(hMsg, CMSG_RECIPIENT_COUNT_PARAM, 0, &nrOfRecipeints, &nrOfRecipientsLen))
249249
{
250250
gdcmErrorMacro( "Decode CMSG_RECIPIENT_COUNT_PARAM failed with error 0x" << std::hex << GetLastError() );

Source/Common/gdcmConfigure.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
#cmakedefine GDCM_HAVE__SNPRINTF
118118
#cmakedefine GDCM_HAVE_LROUND
119119
#cmakedefine GDCM_HAVE_GETTIMEOFDAY
120+
#cmakedefine GDCM_HAVE_ATOLL
120121
#cmakedefine GDCM_HAVE_JSON_OBJECT_OBJECT_GET_EX
121122

122123
// MM: I have a feeling that if GDCM_HAVE_WCHAR_IFSTREAM, then UNICODE filename

Source/Common/gdcmCryptoFactory.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
=========================================================================*/
1414
#include "gdcmCryptoFactory.h"
1515

16-
#ifdef WIN32
16+
#ifdef _WIN32
1717
#include "gdcmCAPICryptoFactory.h"
1818
#endif
1919

@@ -29,7 +29,7 @@ namespace gdcm
2929

3030
CryptoFactory* CryptoFactory::GetFactoryInstance(CryptoLib id)
3131
{
32-
#ifdef WIN32
32+
#ifdef _WIN32
3333
static CAPICryptoFactory capi(CryptoFactory::CAPI);
3434
#endif
3535
#ifdef GDCM_USE_SYSTEM_OPENSSL
@@ -50,9 +50,9 @@ CryptoFactory* CryptoFactory::GetFactoryInstance(CryptoLib id)
5050
#endif // GDCM_HAVE_CMS_RECIPIENT_PASSWORD
5151
#endif // GDCM_USE_SYSTEM_OPENSSL
5252
// We always prefer native API (by default):
53-
#ifdef WIN32
53+
#ifdef _WIN32
5454
id = CryptoFactory::CAPI;
55-
#endif // WIN32
55+
#endif // _WIN32
5656
}
5757

5858
std::map<CryptoLib, CryptoFactory*>::iterator it = getInstanceMap().find(id);

Source/Common/gdcmDirectory.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ unsigned int Directory::Load(FilenameType const &name, bool recursive)
4040
Toplevel = name;
4141
return Explore( Toplevel, recursive );
4242
}
43-
return false;
43+
return 0;
4444
}
4545

4646
unsigned int Directory::Explore(FilenameType const &name, bool recursive)

Source/Common/gdcmSystem.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ bool System::MakeDirectory(const char *path)
158158
bool ok = true;
159159
while(ok && (pos = dir.find('/', pos)) != std::string::npos)
160160
{
161-
topdir = dir.substr(0, pos);
162-
ok = ok && Mkdir(topdir.c_str());
161+
topdir = dir.substr(0, pos+1);
162+
ok = ok && (System::FileIsDirectory(topdir.c_str()) || 0 == Mkdir(topdir.c_str()));
163163
pos++;
164164
}
165165
if( !ok ) return false;

Source/Common/gdcmTerminal.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <iostream>
1818
#include <fstream>
1919

20-
#ifdef WIN32
20+
#ifdef _WIN32
2121
#define WIN32_LEAN_AND_MEAN
2222
#include <windows.h> /* SetConsoleTextAttribute */
2323
#endif
@@ -40,7 +40,7 @@ class ConsoleImp
4040
{
4141
private:
4242
// console implementation details:
43-
#ifdef WIN32
43+
#ifdef _WIN32
4444
HANDLE hConsoleHandle;
4545
CONSOLE_SCREEN_BUFFER_INFO ConsoleInfo;
4646
WORD wNormalAttributes;
@@ -52,7 +52,7 @@ class ConsoleImp
5252
public:
5353
ConsoleImp()
5454
{
55-
#ifdef WIN32
55+
#ifdef _WIN32
5656
hConsoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
5757
GetConsoleScreenBufferInfo(hConsoleHandle, &ConsoleInfo);
5858
wNormalAttributes = ConsoleInfo.wAttributes;
@@ -61,7 +61,7 @@ class ConsoleImp
6161
}
6262
~ConsoleImp()
6363
{
64-
#ifdef WIN32
64+
#ifdef _WIN32
6565
SetConsoleTextAttribute(hConsoleHandle, wNormalAttributes);
6666
}
6767
WORD get_attributes() {
@@ -85,7 +85,7 @@ class ConsoleImp
8585
return command;
8686
}
8787
void set_attributes(int color) {
88-
#ifdef WIN32
88+
#ifdef _WIN32
8989
static const int colors[8] = { 0, 4, 2, 6, 1, 5, 3, 7 };
9090
WORD wAttributes;
9191

@@ -154,7 +154,7 @@ class ConsoleImp
154154
SetConsoleTextAttribute(hConsoleHandle, wAttributes);
155155
#else
156156
(void)color;
157-
#endif //WIN32
157+
#endif //_WIN32
158158
}
159159

160160
};

Source/Common/gdcmWin32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#endif
2121
//-----------------------------------------------------------------------------
2222
// http://gcc.gnu.org/wiki/Visibility
23-
#if defined(WIN32) && defined(GDCM_BUILD_SHARED_LIBS)
23+
#if defined(_WIN32) && defined(GDCM_BUILD_SHARED_LIBS)
2424
#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)
2525
#define GDCM_EXPORT __declspec( dllexport )
2626
#else

Source/Common/zipstreamimpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ zran.c
6464

6565
#include <gdcm_zlib.h>
6666

67-
#ifdef WIN32 /* Window 95 & Windows NT */
67+
#ifdef _WIN32 /* Window 95 & Windows NT */
6868
# define OS_CODE 0x0b
6969
#endif
7070
#if defined(MACOS) || defined(TARGET_OS_MAC)

0 commit comments

Comments
 (0)