fun with _VARIANT_BOOL and __unaligned
This is related to my previous post:
"Dev C++ linker error: undefined reference"
But I have progressed past those symptoms and figured I should start a new thread.
I have imported an MSVC TextEditor project named NoteXPad2 into Dev-C++. Compiling the thing has tunred out to be a real pain in the butt. I just updated all of my header files using microsofts Platform SDK update. This completely changed the set of errors I am seeing. So....
90 percent of the errors seem to trace back to two issues:
The first one begins with a warning:
[Warning] pasting "/" and "/" does not give a valid preprocessing token
NOTE: oaidl.h is not one of my files. This is a header file.
Line 442 of oaidl.h is just
_VARIANT_BOOL is defined in wtypes.h as:
#if !__STDC__ && (_MSC_VER <= 1000)
/* For backward compatibility */
typedef VARIANT_BOOL _VARIANT_BOOL;
/* ANSI C/C++ reserve bool as keyword */
#define _VARIANT_BOOL /##/
Im not sure what my _MSC_VER is. Im on Win2k pro.
Obviously its hitting the slashes in the else statement and not liking it. This is only a warning but it leads to
parse error before `/' token
at the point _VARIANT_BOOL is actually used. Again, the line in question is simply:
so the bad '/' token HAS to come from the #define _VARIANT_BOOL /##/.
The second problem source is much easier to explain:
Every parse error (and there are a lot) that is not explained by the above, just happens to have __unaligned before it.
__unaligned is defined in ShTypes.h:
#endif // __unaligned
But I can find nowhere that _M_IX86 is defined. (Ive done a search of my entire hard drive and found nothing)
Nowhere in my errors does it actually state "__unaligned undeclared" or anything of that nature, but everywhere __unaligned is used it is followed by a parse error.
I cant believe its coincidence.
So ive traced it all back to two damned lines of code, and I STILL cant figure it out!!!!! ARGH!!
Any help would be greatly appreciated.