Skip Menu |
 

This queue is for tickets about the Sys-Syslog CPAN distribution.

Report information
The Basics
Id: 77578
Status: resolved
Priority: 0/
Queue: Sys-Syslog

People
Owner: SAPER [...] cpan.org
Requestors: TONYC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.29
Fixed in: 0.30



Subject: "Constant subroutine LOG_FACMASK redefined" on Haiku-OS
Download (untitled) / with headers
text/plain 1.6k
With the change in RT #77577 Syslog successfully builds under bleadperl, but during make test, I see: ~/dev/perl/git/perl/t> ./perl harness ../cpan/Sys-Syslog/t/*.t ../cpan/Sys-Syslog/t/00-load.t .... Constant subroutine LOG_FACMASK redefined at ../../lib/Sys/Syslog.pm line -1. ../cpan/Sys-Syslog/t/00-load.t .... ok ../cpan/Sys-Syslog/t/constants.t .. Constant subroutine LOG_FACMASK redefined at ../../lib/Sys/Syslog.pm line -1. ../cpan/Sys-Syslog/t/constants.t .. ok ../cpan/Sys-Syslog/t/syslog.t ..... Constant subroutine LOG_FACMASK redefined at ../../lib/Sys/Syslog.pm line -1. ../cpan/Sys-Syslog/t/syslog.t ..... ok All tests successful. Files=3, Tests=309, 1 wallclock secs ( 0.04 usr 0.01 sys + 0.33 cusr 0.11 csys = 0.48 CPU) Result: PASS This happens because Haiku-OS doesn't define LOG_FACMASK, so at the point const-c.inc is included LOC_FACMASK isn't defined, so it defines a LOG_FACMASK using the fallback value. The LOG_FACMASK macro is then defined and const-xs.inc is included, that file seeing the macro is defined also creates a CONSTSUB, producing the warning above. Moving the macro definition above the const-c.inc include prevents the warning. ~/dev/perl/git/perl/t> ./perl harness ../cpan/Sys-Syslog/t/*.t ../cpan/Sys-Syslog/t/00-load.t .... ok ../cpan/Sys-Syslog/t/constants.t .. ok ../cpan/Sys-Syslog/t/syslog.t ..... ok All tests successful. Files=3, Tests=309, 1 wallclock secs ( 0.04 usr 0.01 sys + 0.34 cusr 0.11 csys = 0.49 CPU) Result: PASS I've attached a patch with the fix. It's also present in the haiku branch at: https://github.com/tonycoz/Sys-Syslog/tree/haiku Tony
Subject: facmask.patch
Download facmask.patch
text/x-diff 513b
diff --git a/Syslog.xs b/Syslog.xs index 4bdbb3b..729ce9c 100644 --- a/Syslog.xs +++ b/Syslog.xs @@ -31,17 +31,17 @@ static SV *ident_svptr; +#ifndef LOG_FAC +#define LOG_FACMASK 0x03f8 +#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) +#endif + #include "const-c.inc" #ifndef LOG_PRIMASK #define LOG_PRIMASK 7 #endif -#ifndef LOG_FAC -#define LOG_FACMASK 0x03f8 -#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) -#endif - #ifndef LOG_PRI #define LOG_PRI(p) ((p) & LOG_PRIMASK) #endif
Subject: Re: [rt.cpan.org #77578] "Constant subroutine LOG_FACMASK redefined" on Haiku-OS
Date: Wed, 15 Aug 2012 03:20:40 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Download (untitled) / with headers
text/plain 903b
Tony Cook wrote via RT: Show quoted text
> With the change in RT #77577 Syslog successfully builds under bleadperl, > but during make test, I see: > > ~/dev/perl/git/perl/t> ./perl harness ../cpan/Sys-Syslog/t/*.t > ../cpan/Sys-Syslog/t/00-load.t .... Constant subroutine LOG_FACMASK > redefined at ../../lib/Sys/Syslog.pm line -1. > […] > > This happens because Haiku-OS doesn't define LOG_FACMASK, so at the > point const-c.inc is included LOC_FACMASK isn't defined, so it defines a > LOG_FACMASK using the fallback value. > > The LOG_FACMASK macro is then defined and const-xs.inc is included, that > file seeing the macro is defined also creates a CONSTSUB, producing the > warning above. > > Moving the macro definition above the const-c.inc include prevents the > warning.
Thanks, applied. It will be included in Sys::Syslog version 0.30 -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.