Skip to content

Commit 9586dc9

Browse files
authored
Merge pull request #186 from nillerusr/win64
Win64
2 parents 17ff01c + c69afba commit 9586dc9

16 files changed

+66
-34
lines changed

.github/workflows/build.yml

+23-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
name: Build
22

3-
on:
4-
push:
5-
branches:
6-
- "*"
7-
pull_request:
8-
branches:
9-
- "*"
3+
on: [push, pull_request]
104

115
jobs:
126
build-linux-i386:
@@ -47,6 +41,17 @@ jobs:
4741
./waf.bat configure -T debug
4842
./waf.bat build
4943
44+
build-windows-amd64:
45+
runs-on: windows-2019
46+
47+
steps:
48+
- uses: actions/checkout@v2
49+
- name: Build windows-amd64
50+
run: |
51+
git submodule init && git submodule update
52+
./waf.bat configure -T debug -8
53+
./waf.bat build
54+
5055
build-dedicated-windows-i386:
5156
runs-on: windows-2019
5257

@@ -58,6 +63,17 @@ jobs:
5863
./waf.bat configure -T debug -d
5964
./waf.bat build
6065
66+
build-dedicated-windows-amd64:
67+
runs-on: windows-2019
68+
69+
steps:
70+
- uses: actions/checkout@v2
71+
- name: Build dedicated windows-amd64
72+
run: |
73+
git submodule init && git submodule update
74+
./waf.bat configure -T debug -d -8
75+
./waf.bat build
76+
6177
build-dedicated-linux-i386:
6278
runs-on: ubuntu-18.04
6379

.github/workflows/tests.yml

+15-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
name: Tests
22

3-
on:
4-
push:
5-
branches:
6-
- "*"
7-
pull_request:
8-
branches:
9-
- "*"
3+
on: [push, pull_request]
104

115
jobs:
126
tests-linux-i386:
@@ -40,3 +34,17 @@ jobs:
4034
cd out
4135
$env:Path = "bin";
4236
./unittest.exe
37+
38+
tests-windows-amd64:
39+
runs-on: windows-2019
40+
41+
steps:
42+
- uses: actions/checkout@v2
43+
- name: Run tests windows-amd64
44+
run: |
45+
git submodule init && git submodule update
46+
./waf.bat configure -T release --tests --prefix=out/ -8
47+
./waf.bat install
48+
cd out
49+
$env:Path = "bin";
50+
./unittest.exe

dedicated/sys_ded.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ bool CDedicatedSteamApplication::Create( )
470470
//-----------------------------------------------------------------------------
471471
int main(int argc, char **argv)
472472
{
473-
#ifndef POSIX
473+
#if !defined( POSIX ) && !defined( PLATFORM_64BITS )
474474
_asm
475475
{
476476
fninit

engine/downloadthread.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ DWORD __stdcall DownloadThread( void *voidPtr )
425425
//Thread_DPrintf( "Requesting full download\n%s", headers );
426426
}
427427

428-
rc.hDataResource = InternetOpenUrl(rc.hOpenResource, fullURL, headerPtr, headerLen, flags,(DWORD)(&rc) );
428+
rc.hDataResource = InternetOpenUrl(rc.hOpenResource, fullURL, headerPtr, headerLen, flags, (DWORD_PTR)(&rc) );
429429

430430
// send the request off
431431
if ( !rc.hDataResource )

engine/tmessage.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,17 @@ int ParseDirective( const char *pText )
322322
{
323323
if ( ParseFloats( pText, tempFloat, 4 ) )
324324
{
325-
for ( int i = 0; i < 4; ++i )
325+
// that's original code, msvc2015 generates illegal instruction on amd64 architecture
326+
/*for ( int i = 0; i < 4; ++i )
326327
{
327328
gMessageParms.boxcolor[ i ] = (byte)(int)tempFloat[ i ];
328-
}
329+
}*/
330+
331+
// workaround
332+
gMessageParms.boxcolor[0] = (int)tempFloat[0];
333+
gMessageParms.boxcolor[1] = (int)tempFloat[1];
334+
gMessageParms.boxcolor[2] = (int)tempFloat[2];
335+
gMessageParms.boxcolor[3] = (int)tempFloat[3];
329336
}
330337
}
331338
else if ( IsToken( pText, "clearmessage" ) )

filesystem/filesystem_stdio.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,7 @@ size_t CWin32ReadOnlyFile::FS_fread( void *dest, size_t destSize, size_t size )
14131413
if ( m_hFileUnbuffered != INVALID_HANDLE_VALUE )
14141414
{
14151415
const int destBaseAlign = ( IsX360() ) ? 4 : m_SectorSize;
1416-
bool bDestBaseIsAligned = ( (DWORD)dest % destBaseAlign == 0 );
1416+
bool bDestBaseIsAligned = ( (DWORD_PTR)dest % destBaseAlign == 0 );
14171417
bool bCanReadUnbufferedDirect = ( bDestBaseIsAligned && ( destSize % m_SectorSize == 0 ) && ( m_ReadPos % m_SectorSize == 0 ) );
14181418

14191419
if ( bCanReadUnbufferedDirect )

game/client/client_thinklist.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void CClientThinkList::RemoveThinkable( ClientThinkHandle_t hThink )
158158
{
159159
pThink->SetThinkHandle( INVALID_THINK_HANDLE );
160160
}
161-
m_ThinkEntries.Remove( (unsigned long)hThink );
161+
m_ThinkEntries.Remove( (uintp)hThink );
162162
}
163163

164164

@@ -304,7 +304,7 @@ void CClientThinkList::PerformThinkFunctions()
304304
if ( hThink != INVALID_THINK_HANDLE )
305305
{
306306
// This can happen if the same think handle was removed twice
307-
if ( !m_ThinkEntries.IsInList( (unsigned long)hThink ) )
307+
if ( !m_ThinkEntries.IsInList( (uintp)hThink ) )
308308
continue;
309309

310310
// NOTE: This is necessary for the case where the client entity handle

game/client/client_thinklist.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ inline ClientThinkHandle_t CClientThinkList::GetInvalidThinkHandle()
121121

122122
inline CClientThinkList::ThinkEntry_t* CClientThinkList::GetThinkEntry( ClientThinkHandle_t hThink )
123123
{
124-
return &m_ThinkEntries[ (unsigned long)hThink ];
124+
return &m_ThinkEntries[ (uintp)hThink ];
125125
}
126126

127127

game/client/clientleafsystem.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@ void CClientLeafSystem::ComputeTranslucentRenderLeaf( int count, const LeafIndex
13371337

13381338
static CUtlVector<RenderableInfo_t *> orderedList; // @MULTICORE (toml 8/30/2006): will need to make non-static if thread this function
13391339
static CUtlVector<IClientRenderable *> renderablesToUpdate;
1340-
int leaf = 0;
1340+
intp leaf = 0;
13411341
for ( i = 0; i < count; ++i )
13421342
{
13431343
leaf = pLeafList[i];

game/server/ai_navigator.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ float CAI_Navigator::GetPathTimeToGoal()
12221222
AI_PathNode_t CAI_Navigator::GetNearestNode()
12231223
{
12241224
#ifdef WIN32
1225-
COMPILE_TIME_ASSERT( (int)AIN_NO_NODE == NO_NODE );
1225+
COMPILE_TIME_ASSERT( (intp)AIN_NO_NODE == NO_NODE );
12261226
#endif
12271227
return (AI_PathNode_t)(intp)( GetPathfinder()->NearestNodeToNPC() );
12281228
}

materialsystem/CColorCorrection.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ ColorCorrectionLookup_t::~ColorCorrectionLookup_t( )
7979
void ColorCorrectionLookup_t::AllocTexture()
8080
{
8181
char name[64];
82-
sprintf( name, "ColorCorrection - %d", m_Handle );
82+
sprintf( name, "ColorCorrection - %p", m_Handle );
8383

8484
m_pColorCorrectionTexture = ITextureInternal::CreateProceduralTexture( name, TEXTURE_GROUP_OTHER,
8585
COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE, COLOR_CORRECTION_TEXTURE_SIZE, IMAGE_FORMAT_BGRX8888,

public/basehandle.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ friend class CBaseEntityList;
3030

3131
CBaseHandle();
3232
CBaseHandle( const CBaseHandle &other );
33-
CBaseHandle( unsigned long value );
33+
CBaseHandle( uintp value );
3434
CBaseHandle( int iEntry, int iSerialNumber );
3535

3636
void Init( int iEntry, int iSerialNumber );
@@ -63,7 +63,7 @@ friend class CBaseEntityList;
6363
protected:
6464
// The low NUM_SERIAL_BITS hold the index. If this value is less than MAX_EDICTS, then the entity is networkable.
6565
// The high NUM_SERIAL_NUM_BITS bits are the serial number.
66-
unsigned long m_Index;
66+
uintp m_Index;
6767
};
6868

6969

@@ -80,7 +80,7 @@ inline CBaseHandle::CBaseHandle( const CBaseHandle &other )
8080
m_Index = other.m_Index;
8181
}
8282

83-
inline CBaseHandle::CBaseHandle( unsigned long value )
83+
inline CBaseHandle::CBaseHandle( uintp value )
8484
{
8585
m_Index = value;
8686
}
@@ -150,7 +150,7 @@ inline bool CBaseHandle::operator <( const CBaseHandle &other ) const
150150

151151
inline bool CBaseHandle::operator <( const IHandleEntity *pEntity ) const
152152
{
153-
unsigned long otherIndex = (pEntity) ? pEntity->GetRefEHandle().m_Index : INVALID_EHANDLE_INDEX;
153+
uintp otherIndex = (pEntity) ? pEntity->GetRefEHandle().m_Index : INVALID_EHANDLE_INDEX;
154154
return m_Index < otherIndex;
155155
}
156156

public/saverestoretypes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ struct levellist_t
102102

103103
struct EHandlePlaceholder_t // Engine does some of the game writing (alas, probably shouldn't), but can't see ehandle.h
104104
{
105-
unsigned long i;
105+
uintp i;
106106
};
107107

108108
//-------------------------------------

studiorender/r_studiodraw.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ class CProcessMeshWrapper
11381138
if ( nHasSIMD )
11391139
{
11401140
// Precaches the data
1141-
_mm_prefetch( (char*)((int)pGroupToMesh & (~0x1F)), _MM_HINT_NTA );
1141+
_mm_prefetch( (char*)((intp)pGroupToMesh & (~0x1F)), _MM_HINT_NTA );
11421142
}
11431143
#endif
11441144
for ( int i = 0; i < PREFETCH_VERT_COUNT; ++i )
@@ -1165,7 +1165,7 @@ class CProcessMeshWrapper
11651165
if ( nHasSIMD )
11661166
{
11671167
char *pMem = (char*)&pGroupToMesh[j + PREFETCH_VERT_COUNT + 1];
1168-
_mm_prefetch( (char*)((int)pMem & (~0x1F)), _MM_HINT_NTA );
1168+
_mm_prefetch( (char*)((intp)pMem & (~0x1F)), _MM_HINT_NTA );
11691169
}
11701170
#endif
11711171
idx = j & (PREFETCH_VERT_COUNT-1);

wscript

+2-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,8 @@ def configure(conf):
394394
'/Zc:forScope',
395395
'/Zc:wchar_t',
396396
'/GR',
397-
'/TP'
397+
'/TP',
398+
'/EHsc'
398399
]
399400

400401
if conf.options.BUILD_TYPE == 'debug':

0 commit comments

Comments
 (0)