Repository: lucy-clownfish
Updated Branches:
  refs/heads/master e8b0af8db -> bd045a8af


Fix CFCUtil_warn to not use fprintf

Under ActivePerl/MSVC, the call to fprintf caused a crash. This is
probably due to a combination of

- Perl redefining fprintf and/or stderr
- Different MSVCRT versions used to compile Perl and Clownfish

Switching to Perl's warnings API fixes the crash.

Also use the simpler vcroak for CFCUtil_die.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/64cac460
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/64cac460
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/64cac460

Branch: refs/heads/master
Commit: 64cac46021599d019bba9f31c38a54fd5cb7f249
Parents: e8b0af8
Author: Nick Wellnhofer <[email protected]>
Authored: Mon Jul 21 11:50:22 2014 +0200
Committer: Nick Wellnhofer <[email protected]>
Committed: Mon Jul 21 11:50:22 2014 +0200

----------------------------------------------------------------------
 compiler/src/CFCUtil.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/64cac460/compiler/src/CFCUtil.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCUtil.c b/compiler/src/CFCUtil.c
index 7d8f7a5..fdcfe7a 100644
--- a/compiler/src/CFCUtil.c
+++ b/compiler/src/CFCUtil.c
@@ -495,23 +495,18 @@ CFCUtil_closedir(void *dirhandle, const char *dir) {
 
 void
 CFCUtil_die(const char* format, ...) {
-    SV *errsv = get_sv("@", 1);
     va_list args;
     va_start(args, format);
-    sv_vsetpvf_mg(errsv, format, &args);
+    vcroak(format, &args);
     va_end(args);
-    croak(NULL);
 }
 
 void
 CFCUtil_warn(const char* format, ...) {
-    SV *mess = newSVpv("", 0);
     va_list args;
     va_start(args, format);
-    sv_vsetpvf(mess, format, &args);
+    vwarn(format, &args);
     va_end(args);
-    fprintf(stderr, "%s\n", SvPV_nolen(mess));
-    SvREFCNT_dec(mess);
 }
 
 #else

Reply via email to