Index: modules/sha1/ChangeLog ================================================================== --- modules/sha1/ChangeLog +++ modules/sha1/ChangeLog @@ -1,5 +1,13 @@ +2013-10-29 Andreas Kupries + + * sha1.c: Replaced misuse of cheaders for -D... with proper + * sha1c.tcl: cflags. Depending on whether critcl v2 or v3 + * sha256.c: was used the TCL_BYTE_ORDER was not set, allowing + * sha256c.tcl: build of tcllibc with code for wrong byte order. + Also added code to detect missing definition, and fail build. + 2013-02-01 Andreas Kupries * * Released and tagged Tcllib 1.15 ======================== * Index: modules/sha1/sha1.c ================================================================== --- modules/sha1/sha1.c +++ modules/sha1/sha1.c @@ -22,10 +22,14 @@ #define SHA1HANDSOFF /* Copies data before messing with it. */ #include #include #include "sha1.h" + +#ifndef TCL_BYTE_ORDER +#error "-DTCL_BYTE_ORDER missing" +#endif #ifndef _DIAGASSERT #define _DIAGASSERT(cond) assert(cond) #endif Index: modules/sha1/sha1c.tcl ================================================================== --- modules/sha1/sha1c.tcl +++ modules/sha1/sha1c.tcl @@ -14,11 +14,11 @@ if {$tcl_platform(byteOrder) eq "littleEndian"} { set byteOrder 1234 } else { set byteOrder 4321 } -critcl::cheaders -DTCL_BYTE_ORDER=$byteOrder +critcl::cflags -DTCL_BYTE_ORDER=$byteOrder namespace eval ::sha1 { critcl::ccode { #include "sha1.h" Index: modules/sha1/sha256.c ================================================================== --- modules/sha1/sha256.c +++ modules/sha1/sha256.c @@ -56,10 +56,14 @@ #ifndef lint static const char rcsid[] = "$Id: sha256.c,v 1.3 2007/03/25 11:33:41 patthoyts Exp $"; #endif /* !lint */ + +#ifndef TCL_BYTE_ORDER +#error "-DTCL_BYTE_ORDER missing" +#endif #if TCL_BYTE_ORDER==1234 #else #define WORDS_BIGENDIAN #endif Index: modules/sha1/sha256c.tcl ================================================================== --- modules/sha1/sha256c.tcl +++ modules/sha1/sha256c.tcl @@ -17,11 +17,11 @@ if {$tcl_platform(byteOrder) eq "littleEndian"} { set byteOrder 1234 } else { set byteOrder 4321 } -critcl::cheaders -DTCL_BYTE_ORDER=$byteOrder +critcl::cflags -DTCL_BYTE_ORDER=$byteOrder namespace eval ::sha2 { # Supporting code for the main command. catch { #critcl::debug memory symbols Index: modules/tcllibc.tcl ================================================================== --- modules/tcllibc.tcl +++ modules/tcllibc.tcl @@ -1,10 +1,10 @@ # Umbrella, i.e. Bundle, to put all of the critcl modules which are # found in Tcllib in one shared library. package require critcl -package provide tcllibc 0.3.9 +package provide tcllibc 0.3.10 namespace eval ::tcllib { variable tcllibc_rcsid {$Id: tcllibc.tcl,v 1.13 2010/05/25 19:26:17 andreas_kupries Exp $} critcl::ccode { /* no code required in this file */