MSVC unknown functions/symbols Problem: 1. MSVC does not know __func__ 2. MSVC does not like sizeof(void*) 3. MSVC does not have __alignof__ Solution: 1. a) Put AC_CPP_FUNC in acinclude.m4 b) Added check to configure.ac c) Changed parser/debug.h 2. a) Added AC_CHECK_SIZEOF(void*) to configure.ac b) Changed polynomial/primes_factory.h 3. a) Added AC_CHECK_ALIGNOF(void*) to configure.ac b) Changed polynomial/primes_factory.h
Hi again, On Thu, Sep 9, 2010 at 3:05 PM, Jan Rheinländer <jrheinlaender@gmx.de> wrote:
MSVC unknown functions/symbols
Threre are two problems here. First of all, could you please post a unified patch? A unified patch can be made with the following command diff -Nru ginac.orig ginac.hacked Secondly, I think your code itself is not completely correct.
Problem: 1. MSVC does not know __func__
Please put something like this into the ginac/compiler.h file #ifdef MSVC // or whatever it is #define __func__ "unknown" #endif and #include "complier.h" when necessary.
2. MSVC does not like sizeof(void*)
This sounds a bit strange. AC_CHECK_SIZEOF(void*) definitely invokes sizeof(void*). Could you please exclude this change for now? We'll find the solution later on (when the remaining issues will be ironed out).
3. MSVC does not have __alignof__
However it does have __alignof. Please put the following into ginac/compiler.h #ifdef MSVC // or whatever it is #define __alignof__ __alingof #endif Best regards, Alexei
Hello Alexei, 1. 2. I agree with you.
3. MSVC does not have __alignof__
However it does have __alignof. Please put the following into ginac/compiler.h
#ifdef MSVC // or whatever it is #define __alignof__ __alingof #endif
if we use the AC_CHECK_ALIGNOF method, wouldn't that have the advantage that any future changes in MSVC behaviour (or any other compiler) would be dealt with by the autoconf maintainers? Otherwise someone would have to change compiler.h manually every time. for __func__, since there is no pre-defined autoconf macro anyway, we might as well use compiler.h FYI: The macro is _MSC_VER Best regards, Jan
Hi,
if we use the AC_CHECK_ALIGNOF method, wouldn't that have the advantage that any future changes in MSVC behaviour (or any other compiler) would be dealt with by the autoconf maintainers?
In general I try to avoid using AC_CHECK_* things for computing compile-time constants (like sizeof(foo), __alignof__(foo), etc). auto* tools regenerate config.h way too often, and that results in spurious recompilations. This is not a problem for users, but for it creates additional problems for developers. I mean, when you trying to find out which commit introduced a regression (say, with git bisect), you check out particular version and recompile the thing. auto* tools see the timestamps changed => re-generates Makefiles and config.h => and all files which #include config.h need to be recompiled => waste of time.Therefore I don't quite like AC_CHECK_ALIGNOF thing.
Otherwise someone would have to change compiler.h manually every time.
I don't think such changes happen often. As a matter of fact, __alignof__ works just fine with GCC versions 3.4 through 4.5, i.e. there were no changes in 6 years. Let's hope that ms authors are smart enough to not introduce backward-incompatible changes for no good reason, and use #define instead of autoconf macro. As a last resort we can define alignof<T> template (a la boost). Best regards, Alexei
participants (3)
-
Alexei Sheplyakov
-
Jan private
-
Jan Rheinländer