fix for RT#81748

used https://rt.cpan.org/Ticket/Display.html?id=81748 and http://anisbet-tech-help.blogspot.com/2010/04/conditional-compilation-between-gcc.html