MSVC x64: Compilation issues with current head and LLVM 3.5 final

kink via digitalmars-d-ldc digitalmars-d-ldc at
Sun Sep 21 06:35:33 PDT 2014


Patch 2 isn't complete, I missed the implementation ;) - as I 
didn't get to the obvious linking error yet. :P

diff --git a/dmd2/root/longdouble.h b/dmd2/root/longdouble.h
index d5fbf94..cf6118d 100644
--- a/dmd2/root/longdouble.h
+++ b/dmd2/root/longdouble.h
@@ -198,7 +198,13 @@ longdouble tanl (longdouble ld);

  longdouble fmodl(longdouble x, longdouble y);
  longdouble ldexpl(longdouble ldval, int exp); // see strtold
+#if _MSC_VER < 1800
  longdouble strtold(const char *p,char **endp);
+#else // VS2013 provides strtold(), but returns a double
+longdouble strtold_dmd(const char *p,char **endp);
+#define strtold strtold_dmd

  inline longdouble fabs (longdouble ld) { return fabsl(ld); }
  inline longdouble sqrt (longdouble ld) { return sqrtl(ld); }
diff --git a/vcbuild/strtold.c b/vcbuild/strtold.c
index bbe0188..ffa7398 100644
--- a/vcbuild/strtold.c
+++ b/vcbuild/strtold.c
@@ -136,7 +136,11 @@ static longdouble postab[] =
   * Terminates on first unrecognized character.

+#if _MSC_VER >= 1800
+longdouble strtold_dmd(const char *p,char **endp)
  longdouble strtold(const char *p,char **endp)
          longdouble ldval;
          int exp;


The linking errors when building the ldc2 library vanish as soon 
as I invoke the linker command-line manually and add the 
LLVMX86Utils.lib. It just doesn't work from within VS by editing 
the project options and building.
Anyway, looks like a bug in the CMake config. Unfortunately, I 
don't speak CMake..

More information about the digitalmars-d-ldc mailing list