diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6977112b..779ebc77 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,12 +1,6 @@ name: Build -on: - push: - branches: - - "*" - pull_request: - branches: - - "*" +on: [push, pull_request] jobs: build-linux-i386: @@ -47,6 +41,17 @@ jobs: ./waf.bat configure -T debug ./waf.bat build + build-windows-amd64: + runs-on: windows-2019 + + steps: + - uses: actions/checkout@v2 + - name: Build windows-amd64 + run: | + git submodule init && git submodule update + ./waf.bat configure -T debug -8 + ./waf.bat build + build-dedicated-windows-i386: runs-on: windows-2019 @@ -58,6 +63,17 @@ jobs: ./waf.bat configure -T debug -d ./waf.bat build + build-dedicated-windows-amd64: + runs-on: windows-2019 + + steps: + - uses: actions/checkout@v2 + - name: Build dedicated windows-amd64 + run: | + git submodule init && git submodule update + ./waf.bat configure -T debug -d -8 + ./waf.bat build + build-dedicated-linux-i386: runs-on: ubuntu-18.04 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a0742c16..4974855e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,12 +1,6 @@ name: Tests -on: - push: - branches: - - "*" - pull_request: - branches: - - "*" +on: [push, pull_request] jobs: tests-linux-i386: @@ -40,3 +34,17 @@ jobs: cd out $env:Path = "bin"; ./unittest.exe + + tests-windows-amd64: + runs-on: windows-2019 + + steps: + - uses: actions/checkout@v2 + - name: Run tests windows-amd64 + run: | + git submodule init && git submodule update + ./waf.bat configure -T release --tests --prefix=out/ -8 + ./waf.bat install + cd out + $env:Path = "bin"; + ./unittest.exe diff --git a/dedicated/sys_ded.cpp b/dedicated/sys_ded.cpp index c7a9be92..f1ff4449 100644 --- a/dedicated/sys_ded.cpp +++ b/dedicated/sys_ded.cpp @@ -470,7 +470,7 @@ bool CDedicatedSteamApplication::Create( ) //----------------------------------------------------------------------------- int main(int argc, char **argv) { -#ifndef POSIX +#if !defined( POSIX ) && !defined( PLATFORM_64BITS ) _asm { fninit diff --git a/engine/downloadthread.cpp b/engine/downloadthread.cpp index a79ebff5..882609f7 100644 --- a/engine/downloadthread.cpp +++ b/engine/downloadthread.cpp @@ -425,7 +425,7 @@ DWORD __stdcall DownloadThread( void *voidPtr ) //Thread_DPrintf( "Requesting full download\n%s", headers ); } - rc.hDataResource = InternetOpenUrl(rc.hOpenResource, fullURL, headerPtr, headerLen, flags,(DWORD)(&rc) ); + rc.hDataResource = InternetOpenUrl(rc.hOpenResource, fullURL, headerPtr, headerLen, flags, (DWORD_PTR)(&rc) ); // send the request off if ( !rc.hDataResource ) diff --git a/engine/tmessage.cpp b/engine/tmessage.cpp index 72c65f22..c5e00116 100644 --- a/engine/tmessage.cpp +++ b/engine/tmessage.cpp @@ -322,10 +322,17 @@ int ParseDirective( const char *pText ) { if ( ParseFloats( pText, tempFloat, 4 ) ) { - for ( int i = 0; i < 4; ++i ) + // that's original code, msvc2015 generates illegal instruction on amd64 architecture + /*for ( int i = 0; i < 4; ++i ) { gMessageParms.boxcolor[ i ] = (byte)(int)tempFloat[ i ]; - } + }*/ + + // workaround + gMessageParms.boxcolor[0] = (int)tempFloat[0]; + gMessageParms.boxcolor[1] = (int)tempFloat[1]; + gMessageParms.boxcolor[2] = (int)tempFloat[2]; + gMessageParms.boxcolor[3] = (int)tempFloat[3]; } } else if ( IsToken( pText, "clearmessage" ) ) diff --git a/filesystem/filesystem_stdio.cpp b/filesystem/filesystem_stdio.cpp index f80d4e4a..29caa925 100644 --- a/filesystem/filesystem_stdio.cpp +++ b/filesystem/filesystem_stdio.cpp @@ -1413,7 +1413,7 @@ size_t CWin32ReadOnlyFile::FS_fread( void *dest, size_t destSize, size_t size ) if ( m_hFileUnbuffered != INVALID_HANDLE_VALUE ) { const int destBaseAlign = ( IsX360() ) ? 4 : m_SectorSize; - bool bDestBaseIsAligned = ( (DWORD)dest % destBaseAlign == 0 ); + bool bDestBaseIsAligned = ( (DWORD_PTR)dest % destBaseAlign == 0 ); bool bCanReadUnbufferedDirect = ( bDestBaseIsAligned && ( destSize % m_SectorSize == 0 ) && ( m_ReadPos % m_SectorSize == 0 ) ); if ( bCanReadUnbufferedDirect ) diff --git a/game/client/client_thinklist.cpp b/game/client/client_thinklist.cpp index eae2d880..bbb70a7b 100644 --- a/game/client/client_thinklist.cpp +++ b/game/client/client_thinklist.cpp @@ -158,7 +158,7 @@ void CClientThinkList::RemoveThinkable( ClientThinkHandle_t hThink ) { pThink->SetThinkHandle( INVALID_THINK_HANDLE ); } - m_ThinkEntries.Remove( (unsigned long)hThink ); + m_ThinkEntries.Remove( (uintp)hThink ); } @@ -304,7 +304,7 @@ void CClientThinkList::PerformThinkFunctions() if ( hThink != INVALID_THINK_HANDLE ) { // This can happen if the same think handle was removed twice - if ( !m_ThinkEntries.IsInList( (unsigned long)hThink ) ) + if ( !m_ThinkEntries.IsInList( (uintp)hThink ) ) continue; // NOTE: This is necessary for the case where the client entity handle diff --git a/game/client/client_thinklist.h b/game/client/client_thinklist.h index 3d3e1744..9d3b3b54 100644 --- a/game/client/client_thinklist.h +++ b/game/client/client_thinklist.h @@ -121,7 +121,7 @@ inline ClientThinkHandle_t CClientThinkList::GetInvalidThinkHandle() inline CClientThinkList::ThinkEntry_t* CClientThinkList::GetThinkEntry( ClientThinkHandle_t hThink ) { - return &m_ThinkEntries[ (unsigned long)hThink ]; + return &m_ThinkEntries[ (uintp)hThink ]; } diff --git a/game/client/clientleafsystem.cpp b/game/client/clientleafsystem.cpp index f8e46d88..c00481fd 100644 --- a/game/client/clientleafsystem.cpp +++ b/game/client/clientleafsystem.cpp @@ -1337,7 +1337,7 @@ void CClientLeafSystem::ComputeTranslucentRenderLeaf( int count, const LeafIndex static CUtlVector orderedList; // @MULTICORE (toml 8/30/2006): will need to make non-static if thread this function static CUtlVector renderablesToUpdate; - int leaf = 0; + intp leaf = 0; for ( i = 0; i < count; ++i ) { leaf = pLeafList[i]; diff --git a/game/server/ai_navigator.cpp b/game/server/ai_navigator.cpp index 2825744c..c304bcdc 100644 --- a/game/server/ai_navigator.cpp +++ b/game/server/ai_navigator.cpp @@ -1222,7 +1222,7 @@ float CAI_Navigator::GetPathTimeToGoal() AI_PathNode_t CAI_Navigator::GetNearestNode() { #ifdef WIN32 - COMPILE_TIME_ASSERT( (int)AIN_NO_NODE == NO_NODE ); + COMPILE_TIME_ASSERT( (intp)AIN_NO_NODE == NO_NODE ); #endif return (AI_PathNode_t)(intp)( GetPathfinder()->NearestNodeToNPC() ); } diff --git a/ivp b/ivp index dfa42eb5..960c7228 160000 --- a/ivp +++ b/ivp @@ -1 +1 @@ -Subproject commit dfa42eb575618661a9c41c2ed635c1b9a0a51858 +Subproject commit 960c7228f8e8d710625891991e88b1ec3aa92e45 diff --git a/materialsystem/CColorCorrection.cpp b/materialsystem/CColorCorrection.cpp index 5483d18e..46246658 100644 --- a/materialsystem/CColorCorrection.cpp +++ b/materialsystem/CColorCorrection.cpp @@ -79,7 +79,7 @@ ColorCorrectionLookup_t::~ColorCorrectionLookup_t( ) void ColorCorrectionLookup_t::AllocTexture() { char name[64]; - sprintf( name, "ColorCorrection - %d", m_Handle ); + sprintf( name, "ColorCorrection - %p", m_Handle ); m_pColorCorrectionTexture = ITextureInternal::CreateProceduralTexture( name, TEXTURE_GROUP_OTHER, COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE, IMAGE_FORMAT_BGRX8888, diff --git a/public/basehandle.h b/public/basehandle.h index 91eb02d0..0e35ddb3 100644 --- a/public/basehandle.h +++ b/public/basehandle.h @@ -30,7 +30,7 @@ public: CBaseHandle(); CBaseHandle( const CBaseHandle &other ); - CBaseHandle( unsigned long value ); + CBaseHandle( uintp value ); CBaseHandle( int iEntry, int iSerialNumber ); void Init( int iEntry, int iSerialNumber ); @@ -63,7 +63,7 @@ public: protected: // The low NUM_SERIAL_BITS hold the index. If this value is less than MAX_EDICTS, then the entity is networkable. // The high NUM_SERIAL_NUM_BITS bits are the serial number. - unsigned long m_Index; + uintp m_Index; }; @@ -80,7 +80,7 @@ inline CBaseHandle::CBaseHandle( const CBaseHandle &other ) m_Index = other.m_Index; } -inline CBaseHandle::CBaseHandle( unsigned long value ) +inline CBaseHandle::CBaseHandle( uintp value ) { m_Index = value; } @@ -150,7 +150,7 @@ inline bool CBaseHandle::operator <( const CBaseHandle &other ) const inline bool CBaseHandle::operator <( const IHandleEntity *pEntity ) const { - unsigned long otherIndex = (pEntity) ? pEntity->GetRefEHandle().m_Index : INVALID_EHANDLE_INDEX; + uintp otherIndex = (pEntity) ? pEntity->GetRefEHandle().m_Index : INVALID_EHANDLE_INDEX; return m_Index < otherIndex; } diff --git a/public/saverestoretypes.h b/public/saverestoretypes.h index 4bfb25b4..e470f662 100644 --- a/public/saverestoretypes.h +++ b/public/saverestoretypes.h @@ -102,7 +102,7 @@ struct levellist_t struct EHandlePlaceholder_t // Engine does some of the game writing (alas, probably shouldn't), but can't see ehandle.h { - unsigned long i; + uintp i; }; //------------------------------------- diff --git a/studiorender/r_studiodraw.cpp b/studiorender/r_studiodraw.cpp index da6905fd..c2aee1fb 100644 --- a/studiorender/r_studiodraw.cpp +++ b/studiorender/r_studiodraw.cpp @@ -1138,7 +1138,7 @@ public: if ( nHasSIMD ) { // Precaches the data - _mm_prefetch( (char*)((int)pGroupToMesh & (~0x1F)), _MM_HINT_NTA ); + _mm_prefetch( (char*)((intp)pGroupToMesh & (~0x1F)), _MM_HINT_NTA ); } #endif for ( int i = 0; i < PREFETCH_VERT_COUNT; ++i ) @@ -1165,7 +1165,7 @@ public: if ( nHasSIMD ) { char *pMem = (char*)&pGroupToMesh[j + PREFETCH_VERT_COUNT + 1]; - _mm_prefetch( (char*)((int)pMem & (~0x1F)), _MM_HINT_NTA ); + _mm_prefetch( (char*)((intp)pMem & (~0x1F)), _MM_HINT_NTA ); } #endif idx = j & (PREFETCH_VERT_COUNT-1); diff --git a/wscript b/wscript index 5c12bf40..c2f86949 100644 --- a/wscript +++ b/wscript @@ -394,7 +394,8 @@ def configure(conf): '/Zc:forScope', '/Zc:wchar_t', '/GR', - '/TP' + '/TP', + '/EHsc' ] if conf.options.BUILD_TYPE == 'debug':