[LLVMdev] [PATCH] LLVM 3.0 broken in lib/Support/Windows/DynamicLibrary.inc

Csaba Raduly rcsaba at gmail.com
Wed Nov 2 08:18:38 PDT 2011


Hi,

On Wed, Nov 2, 2011 at 3:22 PM, Ruben Van Boxem wrote:
> I don't know since when, but this file has been changed to remove all the
> trickery (aka defines) needed for MinGW-w64 (and probably everything else
> that as forgotten) to succesfully compile it.

That line was changed in r130657:
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/DynamicLibrary.inc?view=diff&r1=130656&r2=130657

>
> Attached is a patch that reintroduces the compiler checking. I would like to
> see this in LLVM 3.0, otherwise (by the looks of the reintroduced code)
> anything newer than _MSC_VER_1500 will be broken.

I believe this is not the right way to fix it. "Trickery" is in place elsewhere:

$ grep WIN32_ELMCB_PCSTR -rn ../llvm/ | grep -v -- -base
../llvm/configure:19278:#define WIN32_ELMCB_PCSTR $llvm_cv_win32_elmcb_pcstr
../llvm/cmake/config-ix.cmake:370:    set(WIN32_ELMCB_PCSTR "PCSTR")
../llvm/cmake/config-ix.cmake:372:    set(WIN32_ELMCB_PCSTR "PSTR")
../llvm/lib/Support/Windows/DynamicLibrary.inc:46:  static BOOL
CALLBACK ELM_Callback(WIN32_ELMCB_PCSTR ModuleName,
../llvm/include/llvm/Config/config.h.cmake:684:#cmakedefine
WIN32_ELMCB_PCSTR ${WIN32_ELMCB_PCSTR}
../llvm/include/llvm/Config/config.h.in:685:#undef WIN32_ELMCB_PCSTR
../llvm/autoconf/configure.ac:1331:
AC_DEFINE_UNQUOTED([WIN32_ELMCB_PCSTR],$llvm_cv_win32_elmcb_pcstr,[Type
of 1st arg on ELM Callback])
../llvm/projects/sample/configure:19228:#define WIN32_ELMCB_PCSTR
$llvm_cv_win32_elmcb_pcstr
../llvm/projects/sample/autoconf/configure.ac:1264:
AC_DEFINE_UNQUOTED([WIN32_ELMCB_PCSTR],$llvm_cv_win32_elmcb_pcstr,[Type
of 1st arg on ELM Callback])

I have to say that since the only difference appears to be the type of
the first parameter, it is much cleaner to define a macro for it,
rather than a split declaration of the entire function definition.

Csaba
-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds



More information about the llvm-dev mailing list