see if this fixes the build in non-windows

This commit is contained in:
zeromus 2009-04-02 18:37:21 +00:00
parent 8c7c89f036
commit 8009863daa
2 changed files with 12 additions and 2 deletions

View File

@ -2226,8 +2226,8 @@ std::string MakeInputDisplayString(u16 pad, u16 padExt) {
const std::string Buttons[] = {"A", "B", "Sl", "St", "R", "L", "U", "D", "Rs", "Ls"};
const std::string Ext[] = {"X", "Y"};
std::string s = MakeInputDisplayString(pad, Ext, ARRAYSIZE(Ext));
s += MakeInputDisplayString(padExt, Buttons, ARRAYSIZE(Buttons));
std::string s = MakeInputDisplayString(pad, Ext, ARRAY_SIZE(Ext));
s += MakeInputDisplayString(padExt, Buttons, ARRAY_SIZE(Buttons));
return s;
}

View File

@ -332,5 +332,15 @@ inline u16 de16lsb(u8 *morp)
return morp[0]|(morp[1]<<8);
}
#ifndef ARRAY_SIZE
//taken from winnt.h
extern "C++" // templates cannot be declared to have 'C' linkage
template <typename T, size_t N>
char (*BLAHBLAHBLAH( UNALIGNED T (&)[N] ))[N];
#define ARRAY_SIZE(A) (sizeof(*BLAHBLAHBLAH(A)))
#endif
#endif