summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2011-11-28 18:18:25 +1100
committerTony Cook <tony@develop-help.com>2011-11-28 18:18:25 +1100
commite08f19f5d0717ead6e0fc25b4a866d9192e3deb1 (patch)
treefe35750aacf29b16ab23aed0575c8b068051b2fa /ext
parentce2077b184ce12e83580ca1d9686e4af75dc538a (diff)
downloadperl-e08f19f5d0717ead6e0fc25b4a866d9192e3deb1.tar.gz
avoid double defining the POSIX::TCSANOW constant sub
On Win32 which has no native TCSANOW definition this would produce: Constant subroutine TCSANOW redefined at ../lib/POSIX.pm line -1. because the macro wasn't defined when building the unknown symbols table but was defined when building the defined symbols table.
Diffstat (limited to 'ext')
-rw-r--r--ext/POSIX/POSIX.xs8
-rw-r--r--ext/POSIX/lib/POSIX.pm2
2 files changed, 7 insertions, 3 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index 2737559df5..27aabb5d83 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -841,11 +841,15 @@ getattr(termios_ref, fd = 0)
OUTPUT:
RETVAL
+# If we define TCSANOW here then both a found and not found constant sub
+# are created causing a Constant subroutine TCSANOW redefined warning
#ifndef TCSANOW
-# define TCSANOW 0
+# define DEF_SETATTR_ACTION 0
+#else
+# define DEF_SETATTR_ACTION TCSANOW
#endif
SysRet
-setattr(termios_ref, fd = 0, optional_actions = TCSANOW)
+setattr(termios_ref, fd = 0, optional_actions = DEF_SETATTR_ACTION)
POSIX::Termios termios_ref
int fd
int optional_actions
diff --git a/ext/POSIX/lib/POSIX.pm b/ext/POSIX/lib/POSIX.pm
index d90794df3e..e50ee235e6 100644
--- a/ext/POSIX/lib/POSIX.pm
+++ b/ext/POSIX/lib/POSIX.pm
@@ -4,7 +4,7 @@ use warnings;
our ($AUTOLOAD, %SIGRT);
-our $VERSION = '1.26';
+our $VERSION = '1.27';
require XSLoader;