Chris Lattner wrote:> On Tue, 12 Jul 2005, Aaron Gray wrote: > >>>>> Sure, but presumably you want to differentiate between nasm and >>>>> masm (if they are not compatible) right? >>>> >>>> >>>> Right >>> >>> >>> Then you need something more specific than 'isWindows'. I'd >>> suggest, isNASM and isMASM. >> >> >> 'for' rather than 'is' > > > Yeah sorry. > >> forMSVC ? There is more to it than that :( >> I was going from the _WIN32 preprocessor symbol. So maybe 'forWIN32' >> if it is actually needed. > > > I'll leave this to you and jeffc to hash out. I'll point out again > that if NASM and MASM are not the same, that using 'win32' will not > work, because it will be defined for both of them. > > It looks like Nate just committed the subtarget support, so you might > want to look at that. > > -Chris >_WIN32 is not suitable. It will also be defined for mingw, and as Chris pointed out it does not differentiate between NASM and MASM. To check for being built by MSVC++, look for _MSC_VER. I'm not sure how to differentiate between gcc and mingw.
Jeff Cohen wrote:> Chris Lattner wrote: > >> On Tue, 12 Jul 2005, Aaron Gray wrote: >> >>>>>> Sure, but presumably you want to differentiate between nasm and >>>>>> masm (if they are not compatible) right? >>>>> >>>>> >>>>> >>>>> Right >>>> >>>> >>>> >>>> Then you need something more specific than 'isWindows'. I'd >>>> suggest, isNASM and isMASM. >>> >>> >>> >>> 'for' rather than 'is' >> >> >> >> Yeah sorry. >> >>> forMSVC ? There is more to it than that :( >>> I was going from the _WIN32 preprocessor symbol. So maybe 'forWIN32' >>> if it is actually needed. >> >> >> >> I'll leave this to you and jeffc to hash out. I'll point out again >> that if NASM and MASM are not the same, that using 'win32' will not >> work, because it will be defined for both of them. >> >> It looks like Nate just committed the subtarget support, so you might >> want to look at that. >> >> -Chris >> > _WIN32 is not suitable. It will also be defined for mingw, and as > Chris pointed out it does not differentiate between NASM and MASM. > > To check for being built by MSVC++, look for _MSC_VER. I'm not sure > how to differentiate between gcc and mingw. >Use __MINGW32__ for mingw. Also, I'm really not sure what the point is in supporting NASM. Anyone who has Visual Studio has MASM (or ML as it's now called) as well as VC++. Users of gcc/mingw will happily use gas. Who's going to bother getting NASM? VS-based developers will be annoyed enough as it is having to get bison/sed/flex.
Everyone seems to have missed the point. The "Mod for using GAS with MS VC++" as this thread is titled was what it was originally about and why I defined a 'forWindows' bool paralleling 'forCygwin' so that if you compiled for -x86-asm-syntax=attt|intel then the output would work with GAS under Cygwin or MinGW. It was not a great "patch" as where ever forCygwin was I put a forWindows, so it needed a better neater solution. Aaron