Skip to content

Commit

Permalink
Build fixes for some legacy 'tools' which had issues with the namespa…
Browse files Browse the repository at this point in the history
…ce of min/max defines
  • Loading branch information
LiberatorUSA committed Aug 10, 2024
1 parent 2b36a62 commit 9181ba6
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 39 deletions.
41 changes: 23 additions & 18 deletions common/include/gucef_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,27 +116,32 @@ typedef double Float64; /* 8 bytes, signed, decimal */
// //
//-------------------------------------------------------------------------*/

#ifdef __cplusplus
#define GUCEF_NS_FOR_BUILDINS ::GUCEF::
#else
#define GUCEF_NS_FOR_BUILDINS
#endif
/*
* Maximum and minimal values for the build-in types
*/
#define GUCEF_INT8MAX ( (Int8) 127 )
#define GUCEF_INT8MIN ( (Int8) (-128) )
#define GUCEF_UINT8MAX ( (UInt8) 256 )
#define GUCEF_UINT8MIN ( (UInt8) 0 )
#define GUCEF_INT16MAX ( (Int16) 32767 )
#define GUCEF_INT16MIN ( (Int16) (-32767-1) )
#define GUCEF_UINT16MAX ( (UInt16) 65535 )
#define GUCEF_UINT16MIN ( (UInt16) 0 )
#define GUCEF_INT32MAX ( (Int32) 2147483647 )
#define GUCEF_INT32MIN ( (Int32) (-2147483647-1) )
#define GUCEF_UINT32MAX ( (UInt32) 4294967295 )
#define GUCEF_UINT32MIN ( (UInt32) 0 )
#define GUCEF_INT64MIN ( (Int64) -9223372036854775808 )
#define GUCEF_INT64MAX ( (Int64) 9223372036854775807 )
#define GUCEF_UINT64MIN ( (UInt64) 0 )
#define GUCEF_UINT64MAX ( (UInt64) 18446744073709551615 )
#define GUCEF_FLOAT32MAX ( (Float32) (3.40282347E+38F) )
#define GUCEF_FLOAT32MIN ( (Float32) (-3.40282347E+38F-1) )
#define GUCEF_INT8MAX ( (GUCEF_NS_FOR_BUILDINS Int8) 127 )
#define GUCEF_INT8MIN ( (GUCEF_NS_FOR_BUILDINS Int8) (-128) )
#define GUCEF_UINT8MAX ( (GUCEF_NS_FOR_BUILDINS UInt8) 256 )
#define GUCEF_UINT8MIN ( (GUCEF_NS_FOR_BUILDINS UInt8) 0 )
#define GUCEF_INT16MAX ( (GUCEF_NS_FOR_BUILDINS Int16) 32767 )
#define GUCEF_INT16MIN ( (GUCEF_NS_FOR_BUILDINS Int16) (-32767-1) )
#define GUCEF_UINT16MAX ( (GUCEF_NS_FOR_BUILDINS UInt16) 65535 )
#define GUCEF_UINT16MIN ( (GUCEF_NS_FOR_BUILDINS UInt16) 0 )
#define GUCEF_INT32MAX ( (GUCEF_NS_FOR_BUILDINS Int32) 2147483647 )
#define GUCEF_INT32MIN ( (GUCEF_NS_FOR_BUILDINS Int32) (-2147483647-1) )
#define GUCEF_UINT32MAX ( (GUCEF_NS_FOR_BUILDINS UInt32) 4294967295 )
#define GUCEF_UINT32MIN ( (GUCEF_NS_FOR_BUILDINS UInt32) 0 )
#define GUCEF_INT64MIN ( (GUCEF_NS_FOR_BUILDINS Int64) -9223372036854775808 )
#define GUCEF_INT64MAX ( (GUCEF_NS_FOR_BUILDINS Int64) 9223372036854775807 )
#define GUCEF_UINT64MIN ( (GUCEF_NS_FOR_BUILDINS UInt64) 0 )
#define GUCEF_UINT64MAX ( (GUCEF_NS_FOR_BUILDINS UInt64) 18446744073709551615 )
#define GUCEF_FLOAT32MAX ( (GUCEF_NS_FOR_BUILDINS Float32) (3.40282347E+38F) )
#define GUCEF_FLOAT32MIN ( (GUCEF_NS_FOR_BUILDINS Float32) (-3.40282347E+38F-1) )

/*--------------------------------------------------------------------------*/

Expand Down
38 changes: 19 additions & 19 deletions platform/gucefCORE/src/dvcppfileutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -940,36 +940,36 @@ GetAllFileSystemMountPointsForVolume( const CString& volumeId ,
// Structure used to store dir iteration data which is O/S dependent
class CFileSystemIterator::CFileSystemIteratorOsData
{
public:

public:

bool isActive; // Flag indicating if the iterator is active

#if ( GUCEF_PLATFORM == GUCEF_PLATFORM_MSWIN )

intptr_t find_handle; // Unique handle identifying the file or set of files that resulted from a findfirst with the filter provided
struct _wfinddata64_t find; // struct that stores entry data

CFileSystemIteratorOsData( void )
: isActive( false ) // we start with an inactive iterator. A call to FindFirst will activate it potentially
, find_handle( 0 )
{
memset( &find, 0, sizeof find );
struct _wfinddata64_t find; // struct that stores entry data

CFileSystemIteratorOsData( void )
: isActive( false ) // we start with an inactive iterator. A call to FindFirst will activate it potentially
, find_handle( 0 )
{
memset( &find, 0, sizeof find );
}

#elif ( ( GUCEF_PLATFORM == GUCEF_PLATFORM_LINUX ) || ( GUCEF_PLATFORM == GUCEF_PLATFORM_ANDROID ) )

DIR* dir; // Directory stream
struct dirent* entry; // Pointer needed for functions to iterating directory entries. Stores entry name which is used to get stat
struct stat statinfo; // Struct needed for determining info about an entry with stat().

CFileSystemIteratorOsData( void )
: isActive( false )
, dir( GUCEF_NULL )
, entry( GUCEF_NULL )
, statinfo()
{
memset( &statinfo, 0, sizeof statinfo );
}

CFileSystemIteratorOsData( void )
: isActive( false )
, dir( GUCEF_NULL )
, entry( GUCEF_NULL )
, statinfo()
{
memset( &statinfo, 0, sizeof statinfo );
}

#else

Expand All @@ -995,7 +995,7 @@ CFileSystemIterator::~CFileSystemIterator()
if ( GUCEF_NULL != m_osData )
{
FindClose();
GUCEF_DELETE m_osData;
GUCEF_DELETE m_osData;
m_osData = GUCEF_NULL;
}
}
Expand Down
2 changes: 0 additions & 2 deletions platform/gucefKAITAI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ set( HEADER_FILES
includes/gucefKAITAI_CKaitaiSchemaEnumDefinition.h
includes/gucefKAITAI_CKaitaiSchemaFieldDefinition.h
includes/gucefKAITAI_CKaitaiSchemaRegistry.h
includes/gucefKAITAI_CKaitaiSerializer.h
includes/gucefKAITAI_CModule.h
includes/gucefKAITAI_ETypes.h
includes/gucefKAITAI_config.h
Expand All @@ -35,7 +34,6 @@ set( SOURCE_FILES
src/gucefKAITAI_CKaitaiSchemaEnumDefinition.cpp
src/gucefKAITAI_CKaitaiSchemaFieldDefinition.cpp
src/gucefKAITAI_CKaitaiSchemaRegistry.cpp
src/gucefKAITAI_CKaitaiSerializer.cpp
src/gucefKAITAI_CModule.cpp
)

Expand Down

0 comments on commit 9181ba6

Please sign in to comment.