Skip to content

Commit 51543b1

Browse files
committed
Fixed conflict with Windows.h min/max macros
1 parent 4534531 commit 51543b1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

source/main.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ namespace global
4747

4848
template<typename NumericType>
4949
inline NumericType GetNumber( GarrysMod::Lua::ILuaBase *LUA, int32_t idx,
50-
NumericType min = std::numeric_limits<NumericType>::min( ),
51-
NumericType max = std::numeric_limits<NumericType>::max( ) )
50+
NumericType min = (std::numeric_limits<NumericType>::min)( ),
51+
NumericType max = (std::numeric_limits<NumericType>::max)( ) )
5252
{
5353
double number = LUA->CheckNumber( idx );
5454
if( number < static_cast<double>( min ) )

source/sn_bf_read.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ namespace sn_bf_read
210210
LUA->CheckType( 2, GarrysMod::Lua::Type::NUMBER );
211211

212212
int32_t bytes = global::GetNumber<int32_t>( LUA, 2, 1,
213-
BitByte( std::numeric_limits<int32_t>::max( ) ) );
213+
BitByte( (std::numeric_limits<int32_t>::max)( ) ) );
214214

215215
uint8_t *data = UCHARPTR::Push( LUA, bytes * 8 );
216216
LUA->PushBool( buf->ReadBytes( data, bytes ) );

source/ucharptr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ namespace UCHARPTR
140140
LUA_FUNCTION_STATIC( Constructor )
141141
{
142142
int32_t bits = global::GetNumber<int32_t>( LUA, 1, 1,
143-
BitByte( std::numeric_limits<int32_t>::max( ) ) );
143+
BitByte( (std::numeric_limits<int32_t>::max)( ) ) );
144144
Push( LUA, bits * 8 );
145145
return 1;
146146
}

0 commit comments

Comments
 (0)