diff --git a/common/xbox/xboxstubs.h b/common/xbox/xboxstubs.h index fa65d6a8..1392297b 100644 --- a/common/xbox/xboxstubs.h +++ b/common/xbox/xboxstubs.h @@ -329,7 +329,7 @@ enum XUSER_SIGNIN_STATE #if (defined(POSIX)) typedef size_t ULONG_PTR; -#else +#elif !(defined(WIN64)) typedef _W64 unsigned long ULONG_PTR; #endif typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR; diff --git a/lib/public/win64/interfaces.lib b/lib/public/win64/interfaces.lib new file mode 100644 index 00000000..8be90e0e Binary files /dev/null and b/lib/public/win64/interfaces.lib differ diff --git a/lib/public/win64/mathlib.lib b/lib/public/win64/mathlib.lib new file mode 100644 index 00000000..2db1fb3b Binary files /dev/null and b/lib/public/win64/mathlib.lib differ diff --git a/lib/public/win64/tier0.lib b/lib/public/win64/tier0.lib new file mode 100644 index 00000000..4e87eb41 Binary files /dev/null and b/lib/public/win64/tier0.lib differ diff --git a/lib/public/win64/tier1.lib b/lib/public/win64/tier1.lib new file mode 100644 index 00000000..46290467 Binary files /dev/null and b/lib/public/win64/tier1.lib differ diff --git a/lib/public/win64/vstdlib.lib b/lib/public/win64/vstdlib.lib new file mode 100644 index 00000000..da94e3ab Binary files /dev/null and b/lib/public/win64/vstdlib.lib differ diff --git a/mathlib/imagequant.cpp b/mathlib/imagequant.cpp index ce712427..783ca999 100644 --- a/mathlib/imagequant.cpp +++ b/mathlib/imagequant.cpp @@ -57,7 +57,7 @@ void ColorQuantize(uint8 const *Image, { struct QuantizedValue *v=FindQNode(q,p); if (v) - for(int c=0;c<3;c++) + for(c=0;c<3;c++) out_palette[p*3+c]=v->Mean[c]; } memset(Error,0,sizeof(Error)); diff --git a/mathlib/mathlib_base.cpp b/mathlib/mathlib_base.cpp index d8068ea6..8d017a4c 100644 --- a/mathlib/mathlib_base.cpp +++ b/mathlib/mathlib_base.cpp @@ -3236,6 +3236,7 @@ void MathLib_Init( float gamma, float texGamma, float brightness, int overbright { s_bSSEEnabled = true; +#ifndef _WIN64 // Select the SSE specific routines if available pfVectorNormalizeFast = _SSE_VectorNormalizeFast; pfInvRSquared = _SSE_InvRSquared; @@ -3245,6 +3246,7 @@ void MathLib_Init( float gamma, float texGamma, float brightness, int overbright #ifdef _WIN32 pfFastSinCos = _SSE_SinCos; pfFastCos = _SSE_cos; +#endif #endif } else @@ -3255,7 +3257,7 @@ void MathLib_Init( float gamma, float texGamma, float brightness, int overbright if ( bAllowSSE2 && pi.m_bSSE2 ) { s_bSSE2Enabled = true; -#ifdef _WIN32 +#if defined(_WIN32) && !defined(_WIN64) pfFastSinCos = _SSE2_SinCos; pfFastCos = _SSE2_cos; #endif diff --git a/mathlib/quantize.cpp b/mathlib/quantize.cpp index 2f4b64f2..aec1a3ce 100644 --- a/mathlib/quantize.cpp +++ b/mathlib/quantize.cpp @@ -198,8 +198,8 @@ static void UpdateStats(struct QuantizedValue *v) N+=s->Count; for(j=0;jValue[j]; - Means[j]+=v*s->Count; + uint8 v2=s->Value[j]; + Means[j]+=v2*s->Count; } } for(j=0;jValue[i]; LocalMean[i][1]=maxS->Value[i]; diff --git a/mathlib/sse.cpp b/mathlib/sse.cpp index d39c24f8..b984941c 100644 --- a/mathlib/sse.cpp +++ b/mathlib/sse.cpp @@ -16,6 +16,9 @@ // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" +#ifndef COMPILER_MSVC64 +// Implement for 64-bit Windows if needed. + static const uint32 _sincos_masks[] = { (uint32)0x0, (uint32)~0x0 }; static const uint32 _sincos_inv_masks[] = { (uint32)~0x0, (uint32)0x0 }; @@ -843,3 +846,4 @@ vec_t DotProduct (const vec_t *a, const vec_t *c) } */ +#endif // COMPILER_MSVC64 diff --git a/public/bitmap/imageformat.h b/public/bitmap/imageformat.h index b5bdf43b..cd096e9c 100644 --- a/public/bitmap/imageformat.h +++ b/public/bitmap/imageformat.h @@ -25,7 +25,6 @@ enum NormalDecodeMode_t // Forward declaration #ifdef _WIN32 typedef enum _D3DFORMAT D3DFORMAT; -typedef enum DXGI_FORMAT; #endif //----------------------------------------------------------------------------- diff --git a/public/datacache/imdlcache.h b/public/datacache/imdlcache.h index cd805335..7eccfff1 100644 --- a/public/datacache/imdlcache.h +++ b/public/datacache/imdlcache.h @@ -43,7 +43,7 @@ typedef unsigned short MDLHandle_t; inline MDLHandle_t VoidPtrToMDLHandle( void *ptr ) { - return (MDLHandle_t)(int)ptr; + return (MDLHandle_t)(uintp)ptr; } enum diff --git a/public/mathlib/ssemath.h b/public/mathlib/ssemath.h index d24cd643..efcfdddb 100644 --- a/public/mathlib/ssemath.h +++ b/public/mathlib/ssemath.h @@ -2931,6 +2931,12 @@ FORCEINLINE i32x4 IntShiftLeftWordSIMD(const i32x4 &vSrcA, const i32x4 &vSrcB) // like this. FORCEINLINE void ConvertStoreAsIntsSIMD(intx4 * RESTRICT pDest, const fltx4 &vSrc) { +#ifdef COMPILER_MSVC64 + (*pDest)[0] = SubFloat(vSrc, 0); + (*pDest)[1] = SubFloat(vSrc, 1); + (*pDest)[2] = SubFloat(vSrc, 2); + (*pDest)[3] = SubFloat(vSrc, 3); +#else __m64 bottom = _mm_cvttps_pi32( vSrc ); __m64 top = _mm_cvttps_pi32( _mm_movehl_ps(vSrc,vSrc) ); @@ -2938,6 +2944,7 @@ FORCEINLINE void ConvertStoreAsIntsSIMD(intx4 * RESTRICT pDest, const fltx4 &vSr *reinterpret_cast<__m64 *>(&(*pDest)[2]) = top; _mm_empty(); +#endif } diff --git a/public/steam/steamtypes.h b/public/steam/steamtypes.h index 44a20e61..e95147f9 100644 --- a/public/steam/steamtypes.h +++ b/public/steam/steamtypes.h @@ -22,7 +22,7 @@ typedef unsigned char uint8; #define POSIX 1 #endif -#if defined(__x86_64__) || defined(_WIN64) +#if (defined(__x86_64__) || defined(_WIN64)) && !defined(X64BITS) #define X64BITS #endif diff --git a/public/tier1/bitbuf.h b/public/tier1/bitbuf.h index ad8c9dad..19b07ae3 100644 --- a/public/tier1/bitbuf.h +++ b/public/tier1/bitbuf.h @@ -1123,7 +1123,7 @@ FORCEINLINE void CBitRead::GrabNextDWord( bool bOverFlowImmediately ) } else { - Assert( reinterpret_cast(m_pDataIn) + 3 < reinterpret_cast(m_pBufferEnd)); + Assert( reinterpret_cast(m_pDataIn) + 3 < reinterpret_cast(m_pBufferEnd)); m_nInBufWord = LittleDWord( *( m_pDataIn++ ) ); } } diff --git a/tier1/KeyValues.cpp b/tier1/KeyValues.cpp index 450d1279..c433c649 100644 --- a/tier1/KeyValues.cpp +++ b/tier1/KeyValues.cpp @@ -2228,7 +2228,7 @@ bool KeyValues::WriteAsBinary( CUtlBuffer &buffer ) } case TYPE_PTR: { - buffer.PutUnsignedInt( (int)dat->m_pValue ); + buffer.PutPtr( dat->m_pValue ); } default: @@ -2323,7 +2323,7 @@ bool KeyValues::ReadAsBinary( CUtlBuffer &buffer ) } case TYPE_PTR: { - dat->m_pValue = (void*)buffer.GetUnsignedInt(); + dat->m_pValue = buffer.GetPtr(); } default: diff --git a/tier1/bitbuf.cpp b/tier1/bitbuf.cpp index 5279692d..ca77bac4 100644 --- a/tier1/bitbuf.cpp +++ b/tier1/bitbuf.cpp @@ -331,7 +331,7 @@ bool bf_write::WriteBits(const void *pInData, int nBits) } // Align output to dword boundary - while (((unsigned long)pOut & 3) != 0 && nBitsLeft >= 8) + while (((uintp)pOut & 3) != 0 && nBitsLeft >= 8) { WriteUBitLong( *pOut, 8, false ); @@ -808,7 +808,7 @@ void old_bf_read::ReadBits(void *pOutData, int nBits) // align output to dword boundary - while( ((unsigned long)pOut & 3) != 0 && nBitsLeft >= 8 ) + while( ((uintp)pOut & 3) != 0 && nBitsLeft >= 8 ) { *pOut = (unsigned char)ReadUBitLong(8); ++pOut; diff --git a/tier1/checksum_crc.cpp b/tier1/checksum_crc.cpp index 3e0f20d4..6b907ee3 100644 --- a/tier1/checksum_crc.cpp +++ b/tier1/checksum_crc.cpp @@ -147,7 +147,7 @@ JustAfew: // The low-order two bits of pb and nBuffer in total control the // upfront work. // - nFront = ((unsigned int)pb) & 3; + nFront = ((uintp)pb) & 3; nBuffer -= nFront; switch (nFront) { diff --git a/tier1/interface.cpp b/tier1/interface.cpp index dbad03a6..f750efb6 100644 --- a/tier1/interface.cpp +++ b/tier1/interface.cpp @@ -154,7 +154,7 @@ static HMODULE InternalLoadLibrary( const char *pName ) return LoadLibraryEx( pName, NULL, LOAD_WITH_ALTERED_SEARCH_PATH ); #endif } -unsigned ThreadedLoadLibraryFunc( void *pParam ) +uintp ThreadedLoadLibraryFunc( void *pParam ) { ThreadedLoadLibaryContext_t *pContext = (ThreadedLoadLibaryContext_t*)pParam; pContext->m_hLibrary = InternalLoadLibrary(pContext->m_pLibraryName); diff --git a/tier1/newbitbuf.cpp b/tier1/newbitbuf.cpp index 39cfd217..8bd9d1b0 100644 --- a/tier1/newbitbuf.cpp +++ b/tier1/newbitbuf.cpp @@ -483,7 +483,7 @@ void CBitRead::ReadBits(void *pOutData, int nBits) // align output to dword boundary - while( ((unsigned long)pOut & 3) != 0 && nBitsLeft >= 8 ) + while( ((uintp)pOut & 3) != 0 && nBitsLeft >= 8 ) { *pOut = (unsigned char)ReadUBitLong(8); ++pOut; diff --git a/tier1/processor_detect.cpp b/tier1/processor_detect.cpp index a6bfe91b..8c5a9579 100644 --- a/tier1/processor_detect.cpp +++ b/tier1/processor_detect.cpp @@ -10,7 +10,7 @@ #include "processor_detect_linux.cpp" -#elif defined( _X360 ) +#elif defined( _X360 ) || defined( WIN64 ) bool CheckMMXTechnology(void) { return false; } bool CheckSSETechnology(void) { return false; }