# Fix Macintosh line ends tht don't compile under Win32 sub chompnl { # Warning: don't stuff up $1 chop $_[0] while((substr($_[0],-1) eq "\015")||(substr($_[0],-1) eq "\012")); } # chompnl unless(-f "$mxbase/matrixCommon.h.ori") { # only do once rename("$mxbase/matrixCommon.h","$mxbase/matrixCommon.h.ori"); open(IN,"<$mxbase/matrixCommon.h.ori") or die "Can't fix MAC Line ends: $!"; open(OUT,">$mxbase/matrixCommon.h") or die "Can't fix MAC Line ends: $!"; while(my $line=<IN>) { &chompnl($line); print OUT $line . "\n"; # "\n" on unix, "\r\n" on Dos, ??? on Mac. } close(IN); close(OUT); }
Win32 inline mod snippet
NAME
matrixssl_win32_inline - win32 compiler support script
SYNOPSIS
reads < ./matrixssl/*.h writes > ./*.h
DESCRIPTION
Converts the MatrixSSL header files so that Win32 compilations work "inline" (that is: so they don't need a "perl" loading DLL and a MatrixSSL functions DLL - everything is instead put all inside the one DLL)
Changes
1. Comment all '#ifdef __cplusplus'...'#endif' blocks.
2. Inside '#ifdef WIN32'...'#endif' blocks replace
#define ... extern __declspec(dllimport)
#define ... extern __declspec(dllexport)
with
#define ... extern /* __declspec(dllimport) */
#define ... extern /* __declspec(dllexport) */
BUGS
Searches for hardcoded stuff instead of "parsing the header file"; should be OK, but might one day fail if peersec make dramatic changes to their header files.
End of Win32 inline mod snippet