GNU bug report logs -
#9960
Compiling Emacs trunk with MSVC
Previous Next
Reported by: Eli Zaretskii <eliz <at> gnu.org>
Date: Sat, 5 Nov 2011 11:24:02 UTC
Severity: normal
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #89 received at 9960 <at> debbugs.gnu.org (full text, mbox):
> From: Christoph Scholtes <cschol2112 <at> googlemail.com>
> Cc: 9960 <at> debbugs.gnu.org
> Date: Sat, 05 Nov 2011 16:23:40 -0600
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > That comes from Fabrice, assuming that removing `static' doesn't help.
>
> No, it does not.
>
> > Does it fail even if you take (1 << 3) in one more level of
> > parentheses?
>
> Yes.
>
> > What about an intermediate macro, as in
> >
> > #define FOO (1 << GCTYPEBITS)
> > static int __declspec(align(FOO)) test = 1;
> >
> > ?
>
> Not working. I tried all of these cases in my simple example. It does
> seem to like the shift operator.
I guess Fabrice will have to figure this out. I'm puzzled how it
worked for him a year ago.
> > Does this go away if you add "#define snprintf _snprintf" to
> > src/s/ms-w32.h, for MSVC only?
>
> Yes.
>
> > These are because xdisp.c defines window_box_right `inline'. (This is
> > an optimized build, right? if not, does it mean that MSVC inlines
> > functions even for a non-optimized builds?) I would suggest to make
> > that `inline' conditional on _MSC_VER being undefined.
>
> That worked.
>
> > Add "#define strtoimax _strtoi64" to src/s/ms-w32.h, conditioned on
> > _MSC_VER.
>
> Worked.
Please install the 1st and the 3rd of these 3. I'm about to start a
discussion regarding the 2nd one.
> > Make this (from src/s/ms-w32.h):
> >
> > #if !defined (_MSC_VER) || (_MSC_VER < 1400)
> > #define tzname _tzname
> >
> > be defined unconditionally. (But leave the "utime" part under the
> > same condition it is today.)
>
> This is a problem. The ensuing error is:
>
> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\time.h(281) : erro
> r C2090: function returns array
>
> >From time.h:
> _CRT_INSECURE_DEPRECATE_GLOBALS(_get_tzname) _CRTIMP extern char * tzname[2];
How about using _get_tzname to set up our own private array akin to
tzname[]? Here's the plan:
. in src/s/ms-w32.h, "#define tzname msvc_tzname" (for _MSC_VER >= 1400)
. in w32.c:sys_localtime, when _MSC_VER >= 1400, call _get_tzname
twice to populate tzname[] with 2 values as expected
. reinstate HAVE_TZNAME for MSVC
Does this work, i.e. link without errors?
Thanks.
This bug report was last modified 13 years and 61 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.