Skip to content
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

Fix #include <windows.h> #180

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix #include <windows.h> #180

wants to merge 1 commit into from

Conversation

dg0yt
Copy link

@dg0yt dg0yt commented Oct 14, 2024

Inclusion must take place in top-level scope.

Inclusion must take place in top-level scope.
@dg0yt
Copy link
Author

dg0yt commented Oct 14, 2024

Fixes arm64 windows builds issue in vcpkg.

FAILED: Source/Common/CMakeFiles/gdcmCommon.dir/gdcmFilename.cxx.obj 
C:\PROGRA~1\MICROS~1\2022\ENTERP~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\arm64\cl.exe   /TP -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -DgdcmCommon_EXPORTS -ID:\installed\arm64-windows\include -ID:\b\gdcm\arm64-windows-dbg\Source\Common -ID:\b\gdcm\src\v3.0.24-5d851b30d1.clean\Source\Common -ID:\b\gdcm\src\v3.0.24-5d851b30d1.clean\Source\DataStructureAndEncodingDefinition -ID:\b\gdcm\arm64-windows-dbg\Testing\Source\Data -ID:\b\gdcm\src\v3.0.24-5d851b30d1.clean\Testing\Source\Data -ID:\b\gdcm\src\v3.0.24-5d851b30d1.clean\Utilities /nologo /DWIN32 /D_WINDOWS /utf-8 /GR /EHsc /MP  /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 /showIncludes /FoSource\Common\CMakeFiles\gdcmCommon.dir\gdcmFilename.cxx.obj /FdSource\Common\CMakeFiles\gdcmCommon.dir\ /FS -c D:\b\gdcm\src\v3.0.24-5d851b30d1.clean\Source\Common\gdcmFilename.cxx
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\winbase.h(9715): error C2664: 'unsigned int gdcm::_InterlockedIncrement(volatile unsigned int *)': cannot convert argument 1 from 'volatile long *' to 'volatile unsigned int *'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\winbase.h(9715): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\winbase.h(9711): note: see declaration of 'gdcm::_InterlockedIncrement'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\winbase.h(9715): note: while trying to match the argument list '(volatile long *)'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\winbase.h(9724): error C2665: 'gdcm::_InterlockedIncrement': no overloaded function could convert all the argument types
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\winbase.h(9720): note: could be 'unsigned long gdcm::_InterlockedIncrement(volatile unsigned long *)'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\winbase.h(9724): note: 'unsigned long gdcm::_InterlockedIncrement(volatile unsigned long *)': cannot convert argument 1 from 'volatile long *' to 'volatile unsigned long *'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\winbase.h(9724): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\winbase.h(9711): note: or       'unsigned int gdcm::_InterlockedIncrement(volatile unsigned int *)'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\winbase.h(9724): note: 'unsigned int gdcm::_InterlockedIncrement(volatile unsigned int *)': cannot convert argument 1 from 'volatile long *' to 'volatile unsigned int *'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\winbase.h(9724): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\winbase.h(9724): note: while trying to match the argument list '(volatile long *)'
...

(Note the unexpected gdcm:: prefix.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant