Apply partial solution for Windows builds of Cap5

This commit is contained in:
Andrew Johnson
2016-04-25 11:54:17 -05:00
parent 8358580190
commit de38b80795
2 changed files with 21 additions and 6 deletions
+14 -4
View File
@@ -1138,6 +1138,20 @@ void CA_add_exception_event(const char *class, SV *sub) {
static
SV * printf_sub = NULL;
#ifndef va_copy
# ifdef __GNUC__
# define va_copy(d, s) __va_copy(d, s)
# else
# define va_copy(d, s) ((d) = (s))
/* The above macro is NOT PORTABLE but works on Windows when
* stdarg.h doesn't provide va_copy(). Some architectures need
* define va_copy(d, s) ((*d) = (*s))
* while others may be even more complicated, but hopefully the
* system stdarg.h header defines va_copy() in those cases.
*/
# endif
#endif
static
int printf_handler(const char *format, va_list args) {
if (! printf_sub)
@@ -1152,11 +1166,7 @@ int printf_handler(const char *format, va_list args) {
ENTER;
SAVETMPS;
#ifdef __GNUC__
__va_copy(argcopy, args);
#else
va_copy(argcopy, args);
#endif
printf_str = NEWSV(0, strlen(format) + 32);
sv_vsetpvf(printf_str, format, &argcopy);
+7 -2
View File
@@ -3,7 +3,12 @@
# This script is used to extract information about the Perl build
# configuration, so the EPICS build system uses the same settings.
use strict;
use Config;
my $arg = shift;
print $Config{$arg};
my $val = $Config{shift};
$val =~ s{\\}{/}go
if $^O eq 'MSWin32';
print $val;