Skip to content

Commit

Permalink
xrCore/Core: More compiler-dependent code moved to platform header.
Browse files Browse the repository at this point in the history
xrCDB/xrCDB.h: Removed own ALIGN definition.
  • Loading branch information
Kaffeine committed Nov 6, 2015
1 parent 3aa8aca commit d942558
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 39 deletions.
5 changes: 0 additions & 5 deletions src/xrCDB/xrCDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
#else
# define XRCDB_API XR_IMPORT
#endif
#ifdef M_VISUAL
#define ALIGN(a) __declspec(align(a))
#else
#define ALIGN(a)
#endif

// forward declarations
class CFrustum;
Expand Down
32 changes: 32 additions & 0 deletions src/xrCore/Platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,44 @@
# define ICN __declspec (noinline)
#endif

#include <time.h>
// work-around dumb borland compiler
#ifdef __BORLANDC__
#define ALIGN(a)

#include <vcl.h>
#include <mmsystem.h>
#include <stdint.h>
#include <assert.h>
#include <utime.h>
#define _utimbuf utimbuf

// function redefinition
#define fabsf(a) fabs(a)
#define sinf(a) sin(a)
#define asinf(a) asin(a)
#define cosf(a) cos(a)
#define acosf(a) acos(a)
#define tanf(a) tan(a)
#define atanf(a) atan(a)
#define sqrtf(a) sqrt(a)
#define expf(a) ::exp(a)
#define floorf floor
#define atan2f atan2
#define logf log
// float redefine
#define _PC_24 PC_24
#define _PC_53 PC_53
#define _PC_64 PC_64
#define _RC_CHOP RC_CHOP
#define _RC_NEAR RC_NEAR
#define _MCW_EM MCW_EM
#else
#define ALIGN(a) __declspec(align(a))
#include <sys\utime.h>
#endif


#define NOGDICAPMASKS
//#define NOSYSMETRICS
#define NOMENUS
Expand Down
34 changes: 0 additions & 34 deletions src/xrCore/xrCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,41 +102,7 @@
#endif

#include <time.h>
// work-around dumb borland compiler
#ifdef __BORLANDC__
#define ALIGN(a)

#include <assert.h>
#include <utime.h>
#define _utimbuf utimbuf
#define MODULE_NAME "xrCoreB.dll"

// function redefinition
#define fabsf(a) fabs(a)
#define sinf(a) sin(a)
#define asinf(a) asin(a)
#define cosf(a) cos(a)
#define acosf(a) acos(a)
#define tanf(a) tan(a)
#define atanf(a) atan(a)
#define sqrtf(a) sqrt(a)
#define expf(a) ::exp(a)
#define floorf floor
#define atan2f atan2
#define logf log
// float redefine
#define _PC_24 PC_24
#define _PC_53 PC_53
#define _PC_64 PC_64
#define _RC_CHOP RC_CHOP
#define _RC_NEAR RC_NEAR
#define _MCW_EM MCW_EM
#else
#define ALIGN(a) __declspec(align(a))
#include <sys\utime.h>
#define MODULE_NAME "xrCore.dll"
#endif


// Warnings
#pragma warning (disable : 4251 ) // object needs DLL interface
Expand Down

0 comments on commit d942558

Please sign in to comment.