Fix CPLUSPLUS=1 CLANG=1 building, and fix the "gotpic used attribute ignored" warning produced by clang.

git-svn-id: https://svn.eduke32.com/eduke32@3162 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2012-11-15 06:42:00 +00:00
parent c9cd191bce
commit c6bbb0547b
2 changed files with 8 additions and 18 deletions

View file

@ -514,7 +514,13 @@ EXTERN char show2dsprite[(MAXSPRITES+7)>>3];
// In the editor, gotpic is only referenced from inline assembly;
// the compiler needs that hint or building with LTO will discard it.
EXTERN char ATTRIBUTE((used)) gotpic[(MAXTILES+7)>>3];
#ifndef __clang__
# define GOTPIC_USED ATTRIBUTE((used))
#else
# define GOTPIC_USED
#endif
EXTERN char GOTPIC_USED gotpic[(MAXTILES+7)>>3];
EXTERN char gotsector[(MAXSECTORS+7)>>3];
EXTERN char editorcolors[256];

View file

@ -3,9 +3,9 @@
template<typename TrackedType>
class __TRACKER_NAME
{
public:
TrackedType TrackedValue;
public:
inline TrackedType* operator & ()
{
__TRACKER_GLOBAL_HOOK((uintptr_t)&this->TrackedValue);
@ -37,34 +37,24 @@ class __TRACKER_NAME
}
inline TrackedType operator = (TrackedType);
inline TrackedType operator = (__TRACKER_NAME<TrackedType>);
inline TrackedType operator += (TrackedType);
inline TrackedType operator += (__TRACKER_NAME<TrackedType>);
inline TrackedType operator -= (TrackedType);
inline TrackedType operator -= (__TRACKER_NAME<TrackedType>);
inline TrackedType operator *= (TrackedType);
inline TrackedType operator *= (__TRACKER_NAME<TrackedType>);
inline TrackedType operator /= (TrackedType);
inline TrackedType operator /= (__TRACKER_NAME<TrackedType>);
inline TrackedType operator |= (TrackedType);
inline TrackedType operator |= (__TRACKER_NAME<TrackedType>);
inline TrackedType operator &= (TrackedType);
inline TrackedType operator &= (__TRACKER_NAME<TrackedType>);
inline TrackedType operator ^= (TrackedType);
inline TrackedType operator ^= (__TRACKER_NAME<TrackedType>);
inline TrackedType operator <<= (TrackedType);
inline TrackedType operator <<= (__TRACKER_NAME<TrackedType>);
inline TrackedType operator >>= (TrackedType);
inline TrackedType operator >>= (__TRACKER_NAME<TrackedType>);
inline operator TrackedType() const;
};
@ -81,12 +71,6 @@ enum {
#endif
#define __TRACKER_RIGHTHAND_TYPE __TRACKER_NAME<TrackedType> rightHand
#define __TRACKER_RIGHTHAND rightHand.TrackedValue
#include "tracker_operators.hpp"
#undef __TRACKER_RIGHTHAND_TYPE
#undef __TRACKER_RIGHTHAND
#define __TRACKER_RIGHTHAND_TYPE TrackedType rightHand
#define __TRACKER_RIGHTHAND rightHand
#include "tracker_operators.hpp"