Compare commits

..
Author SHA1 Message Date
jan.nijtmans 7248e185c4 Fix TCL_MEM_DEBUG build 2025-09-07 19:30:53 +00:00
jan.nijtmans 439d6c8c82 update doc 2025-09-05 09:12:52 +00:00
jan.nijtmans 8427c0c455 Introduce Tcl_AttemptGetCharLength() 2025-09-05 07:08:59 +00:00
jan.nijtmans 88f46ca664 Rebase to trunk 2025-09-04 15:01:00 +00:00
jan.nijtmans d5eccf9907 Use TclAttemptGetString() in "string repeat". Fix Tcl_AttemptNewStringObj in debug mode 2025-09-04 14:57:01 +00:00
jan.nijtmans 64287131fc Microsoft compilers don't have mode_t 2025-09-04 09:42:42 +00:00
jan.nijtmans d6f93ff450 Fix some -Wconversion warnings 2025-09-04 09:33:13 +00:00
jan.nijtmans 961684edff more Minor indent fixes 2025-09-04 08:59:08 +00:00
dkf 6b52ee1bdf Minor indent fixes 2025-09-04 08:24:38 +00:00
dkf 22de896416 Fix a minor typo in a comment 2025-09-04 08:09:58 +00:00
jan.nijtmans fddae29c41 In no-deprecate mode, don't run tests involving sqlite3. TCL_HASH_TYPE is an internal type, which shouldn't be used by extensions. 2025-09-02 13:13:31 +00:00
jan.nijtmans a27c0164cf Merge 9.0 2025-09-02 07:18:29 +00:00
jan.nijtmans 648ab28529 Update to burnett01/rsync-deployments@7.1.0 2025-09-02 07:17:37 +00:00
jan.nijtmans a251837534 Update UNICODE_OUT_OF_RANGE to handle all planes. Remove unneeded UNICODE_OUT_OF_RANGE() usage 2025-09-01 11:03:24 +00:00
dkf f924c7b244 Merge 9.0 2025-09-01 08:31:25 +00:00
dkf 82895be625 Add code comments, move a function to a better file to own it. 2025-09-01 08:19:50 +00:00
jan.nijtmans ee7950cf32 Merge 9.0 2025-09-01 07:26:29 +00:00
jan.nijtmans de01419022 Fix [85fc8bca03]: Pointer arithmetic with NULL in buildInfoObjCmd(). Update changes.md 2025-09-01 07:24:27 +00:00
apnadkarni d45e087497 Merge 9.0 - Mount zipfs early - see [87b69745be] 2025-09-01 04:58:34 +00:00
apnadkarni 69ab106ada Mount zipfs early - see [87b69745be] 2025-09-01 03:52:45 +00:00
jan.nijtmans 4c575021c7 Final verdict, without test expectation changes 2025-08-31 20:13:49 +00:00
jan.nijtmans 3a9e04c001 Oops, 21 bits, not 17 bits 2025-08-31 20:03:32 +00:00
jan.nijtmans 880c78393c Final verdict, without test expectation changes 2025-08-31 19:14:42 +00:00
jan.nijtmans e6b77e0b06 Merge 9.1 2025-08-31 17:47:54 +00:00
jan.nijtmans 7effd2e72c Merge 9.0. Fix TIP #726 implementation, so all functions give the same answer as Tcl 9.0 for out-of-bound characters 2025-08-31 17:16:26 +00:00
jan.nijtmans 385adbd9bd Add testcases for out-of-range Unicode characters 2025-08-31 16:38:23 +00:00
dkf 96b15ff9f6 Bump the patchlevel of TclOO 2025-08-31 06:14:11 +00:00
dkf 4dab6d3efb Bump the patchlevel of TclOO 2025-08-31 06:13:13 +00:00
dkf fc0255af91 merge core-9-0-branch 2025-08-30 21:20:01 +00:00
dkf d9d4467ee7 Make things that ought to be constants be so. 2025-08-30 20:36:31 +00:00
dkf 4443c3177b Put the baseline cloning (oo::object-><cloned>) of objects in C. 2025-08-30 15:13:31 +00:00
dkf f4d4331782 Backport of oo::object-><cloned> in C. 2025-08-30 15:11:38 +00:00
dkf b3960702d2 Backport of oo::object-><cloned> in C. 2025-08-30 15:10:23 +00:00
jan.nijtmans 2ac9cdcd73 Sorry Ashok, but I object to changing a right-shift (as it originally was) to a left-shift. Will explain by mail. 2025-08-30 14:36:15 +00:00
dkf 6cc00def7f Put the baseline cloning of objects in C. I'd been putting off doing this for over a decade, as it was always going to be a lot of work despite all the inefficiency... 2025-08-30 14:16:57 +00:00
apnadkarni 568aff25e3 TIP 726 2025-08-30 08:45:59 +00:00
jan.nijtmans 435c078290 More review: Eliminate UNICODE_OUT_OF_RANGE and use right-shifts 2025-08-29 13:24:17 +00:00
apnadkarni 93dd0ea623 Fix bogus assert in unicode normalization 2025-08-29 08:56:18 +00:00
apnadkarni 5406225cc1 Update changes.md 2025-08-29 02:59:15 +00:00
apnadkarni 0fad3893a7 Merge main 2025-08-29 02:58:33 +00:00
dkf 49201a46ad merge core-9-0-branch 2025-08-28 15:07:12 +00:00
dkf 71018d9954 More backported initialisation acceleration of TclOO 2025-08-28 14:56:47 +00:00
dkf 188c4a20f4 Modify code and comments for 9.0 style 2025-08-28 14:54:14 +00:00
dkf 2439cb752a Move more machinery into C from the TclOO init script 2025-08-28 14:23:48 +00:00
dkf feb0337f75 Tinkering, making code simpler or easier to maintain 2025-08-28 14:20:33 +00:00
dkf 08c1b1b2c6 Complete the moving of the definition of slots entirely into C 2025-08-28 14:19:13 +00:00
dkf bd73d3bc98 Move more machinery into C from the TclOO init script 2025-08-28 14:02:03 +00:00
dkf 30d34a3e70 Tweak comments 2025-08-28 13:49:30 +00:00
dkf 9ac7d18c6d Move oo::class::<cloned> into C 2025-08-28 13:41:47 +00:00
dkf fa8c01a36d Move remaining bits of property system into C; only cloning methods now left 2025-08-28 12:17:27 +00:00
dkf d0e53f4558 merge trunk 2025-08-28 10:39:41 +00:00
apnadkarni 2c5e56832a Merge 9.0 - Eliminate TCL_BROKEN_MAINARGS 2025-08-28 08:42:46 +00:00
apnadkarni 5f54d6e35c Eliminate TCL_BROKEN_MAINARGS 2025-08-28 08:32:19 +00:00
apnadkarni 14e507ab0f Fix unsigned char* to char* conversion warning 2025-08-28 07:52:49 +00:00
apnadkarni 69726197d8 Merge main 2025-08-28 07:18:16 +00:00
jan.nijtmans d3daca383d 2 review remarks: _CRT_glob is still necessary. And please use autoconf 2.72.
Tx for the fix - Ashok
2025-08-28 06:21:00 +00:00
apnadkarni 652558eef5 Merge 9.0 2025-08-28 06:06:37 +00:00
apnadkarni 434e26477d Get rid of obsolete TCL_BROKEN_MAINARGS 2025-08-28 03:26:11 +00:00
jan.nijtmans e2f0af2714 Fix double Tcl_Alloc define. Tweak allocation lengths reporting 2025-08-27 21:51:42 +00:00
jan.nijtmans a20eb8bc6a Rebase to latest trunk 2025-08-27 15:38:43 +00:00
jan.nijtmans bf2c7d3f0a Merge 9.0 2025-08-27 11:58:50 +00:00
jan.nijtmans 4dce301da4 Follow-up to [66cd465323]: For Tcl 9.0+, building on 32-bit MacOS is no longer supported 2025-08-27 11:57:47 +00:00
jan.nijtmans 9f4d273655 Follow-up to [66cd465323]: For Tcl 9.0+, building on 32-bit MacOS is no longer supported 2025-08-27 11:22:17 +00:00
jan.nijtmans 7de3da420f 32-bit MacOS builds are no longer supported, starting with Tcl 9.0. 2025-08-27 09:37:29 +00:00
apnadkarni 986775b761 Mount ALL zipfs archives before ANY library searches 2025-08-27 05:57:12 +00:00
apnadkarni b5dd9ceaab Create new branch named "apn-early-zipfs-mounts" 2025-08-27 05:41:45 +00:00
dkf b3722a8c03 merge trunk 2025-08-26 13:38:30 +00:00
jan.nijtmans af55dc01d8 Merge 9.0 2025-08-26 08:14:32 +00:00
sebres 029911a413 merge 9.0 2025-08-25 23:17:15 +00:00
sebres 4478afff2a fixes too earlier search for tcl-library (TclZipfsLocateTclLibrary shall be invoked after zipfs mount). 2025-08-25 22:55:02 +00:00
sebres 5860f82135 amend to [0433b67adc] (ticket [87b69745be]): don't return with OK (swallow the error) if encoding cannot be loaded, and current system encoding is NULL for whatever reason 2025-08-25 16:42:09 +00:00
jan.nijtmans ac8205c8ee Merge 9.0 2025-08-25 15:34:57 +00:00
jan.nijtmans a4b27124be [66cd465323] Platform package simplifications for MacOS >= 11. Platform => 1.1.0 2025-08-25 15:32:36 +00:00
dkf 5c6745ec03 Move the oo::configurable constructor into C 2025-08-25 15:23:25 +00:00
jan.nijtmans 3b26998f18 [66cd465323] Platform package simplifications for MacOS >= 11. Platform => 1.1.0 2025-08-25 15:08:09 +00:00
jan.nijtmans 2ecb2c5da4 Remove some more references to non-existing Tcl version 8.7 2025-08-25 11:49:51 +00:00
jan.nijtmans d284f9118b Remove some more references to non-existing Tcl version 8.7 2025-08-25 11:42:28 +00:00
jan.nijtmans b33dac7519 Merge trunk 2025-08-25 11:16:05 +00:00
jan.nijtmans 42725da7ba Merge 9.0 2025-08-25 11:13:06 +00:00
dkf f3cd1bab12 Move more of configurable's machinery into C 2025-08-25 10:59:22 +00:00
jan.nijtmans a95bde4890 Fix testcase oo-1.21 2025-08-25 09:37:02 +00:00
jan.nijtmans 71a5f30a95 Merge 8.6 2025-08-25 09:17:19 +00:00
jan.nijtmans 535d9351df Fix handling of i386-x86_64 in platform extension. Add testcases for this (and other) situation 2025-08-25 08:51:05 +00:00
dkf 2109289587 Fix bugs 2025-08-25 08:43:14 +00:00
dkf e31b21beff Move extra classes into C; mostly there, but not yet working 2025-08-25 08:30:32 +00:00
dkf d50475d2e7 Start of making the singleton class implemented in C 2025-08-24 11:47:45 +00:00
dkf 7f743eb32b Tinkering, making code simpler or easier to maintain 2025-08-24 10:40:58 +00:00
dkf 0321a464b9 Complete the moving of the definition of slots entirely into C 2025-08-24 06:52:11 +00:00
dkf 232912fd60 merge core-9-0-branch (sync after backport) 2025-08-23 08:23:41 +00:00
dkf 940919e356 Backported accelerations to TclOO's startup code 2025-08-23 08:00:12 +00:00
dkf a9af7dc696 corrections (createhashentry is different in 9.1) and cleanup (I like command tables) 2025-08-23 07:57:28 +00:00
jan.nijtmans 0a6c6bf801 Merge-mark 2025-08-22 20:27:01 +00:00
dkf 14b58a3e20 Make code style be a bit closer to the one used in 9.0 2025-08-22 19:36:33 +00:00
dkf 102d340fa6 Tweak to [configurable] to not call [next] twice (backport) 2025-08-22 19:30:49 +00:00
dkf 05ad3060a8 Combine UpdateClassDelegatesAfterClone into its caller. (backport) 2025-08-22 19:29:51 +00:00
dkf 538ca551b7 Move another definition (classmethod) into C. (backport) 2025-08-22 19:28:48 +00:00
jan.nijtmans 7e4c95c24e Fix memory debugging info 2025-08-22 19:25:13 +00:00
dkf 10b1362daa Move [link] into C. (backport) 2025-08-22 19:22:05 +00:00
dkf 0a21b6eed5 Convert MixinClassDelegates to an internal function entirely in C (backport) 2025-08-22 19:14:27 +00:00
dkf 61e2cc66b9 Move a bit of internal machinery (backport) 2025-08-22 17:36:48 +00:00
dkf 8bced55797 Move another command into C: classvariable (backport) 2025-08-22 17:35:43 +00:00
dkf cd0fea5763 Slightly faster way to write the init script (backport) 2025-08-22 17:31:50 +00:00
dkf 1154dfa4f0 Rewrite slots in C to get a performance boost. (backport) 2025-08-22 17:31:18 +00:00
dkf a93fc66525 Speed up TclOO init; no directing via unknown method handler for slots of classes we define ourselves (backport) 2025-08-22 17:18:32 +00:00
dkf a83fb66df9 Slightly chisel down the execution time of the oo init script (backport) 2025-08-22 17:17:22 +00:00
dkf ff93032670 Accelerate definition of [oo::define initialise]. (backport) 2025-08-22 17:15:48 +00:00
dkf 63e9714b2e Start making TclOO faster to initialise (backport) 2025-08-22 15:02:51 +00:00
dkf cca1a031f7 Fix memory debugging info 2025-08-22 14:52:30 +00:00
dkf 800194c7f4 Tweak to [configurable] to not call [next] twice 2025-08-22 14:23:56 +00:00
dkf eb58711740 Combine UpdateClassDelegatesAfterClone into its caller. 2025-08-22 13:43:50 +00:00
jan.nijtmans dace399671 Add testcases for platform macos26-x86_64 and macos26-arm 2025-08-22 13:06:31 +00:00
jan.nijtmans 65b29252af Fix handling of i386-x86_64 2025-08-22 12:50:28 +00:00
dkf 6a89806ee6 Move [link] into C. 2025-08-22 11:45:24 +00:00
jan.nijtmans 165eea24c0 Merge 9.0 2025-08-22 11:29:34 +00:00
dkf 1e47aa3a2e Move another definition (classmethod) into C. 2025-08-22 07:50:00 +00:00
dkf 03c0cbaafd Convert MixinClassDelegates to an internal function entirely in C 2025-08-22 07:19:52 +00:00
dkf 03dd129a16 Fix memory debugging info 2025-08-22 07:16:45 +00:00
dgp 7093dc16ae Make logical -> bitwise correction corresponding to recent change in Tcl 9. 2025-08-21 16:21:10 +00:00
jan.nijtmans 4864c57e4d Eliminate clang compiler warning: use of logical '&&' with constant operand 2025-08-21 15:53:11 +00:00
jan.nijtmans 4ee7135c5a Line no longer needed 2025-08-21 14:15:40 +00:00
jan.nijtmans 905f8b73d7 Add testcases 2025-08-21 14:00:13 +00:00
jan.nijtmans 17a2efee72 Keep all macos < 11 handling as it was 2025-08-20 21:53:34 +00:00
dkf f80e08da71 Move a bit of internal machinery 2025-08-20 12:22:28 +00:00
dkf 10f3bcbb8d Move another command into C: classvariable 2025-08-20 10:11:04 +00:00
jan.nijtmans c7706471ad Bug-fixing 2025-08-19 21:48:16 +00:00
dkf c418b4db02 Slightly faster way to write the init script 2025-08-19 15:45:53 +00:00
jan.nijtmans 562da42399 Experimental simplification for platform on MacOS 2025-08-19 15:05:34 +00:00
dkf 88928b4fff Rewrite slots in C to get a performance boost. [effa2e2346] 2025-08-19 14:49:15 +00:00
dkf e125854648 Add some documentation comments 2025-08-19 14:46:11 +00:00
dkf dde7348f86 Add remoaining slot ops 2025-08-19 14:15:18 +00:00
dkf 2d4422bbba Saner C implementation of slot methods; add unknown handler to C side 2025-08-19 13:51:54 +00:00
jan.nijtmans 01f1143ddf Merge 9.0 2025-08-19 12:45:39 +00:00
jan.nijtmans 0aad2eded0 support for MacOS Tahoe, platform => 1.0.20 2025-08-19 12:44:36 +00:00
jan.nijtmans fa96d47dfc support for MacOS Tahoe, platform => 1.0.20 2025-08-19 12:36:22 +00:00
dkf 0dcd38a24d merge trunk 2025-08-19 10:59:14 +00:00
dkf 9582b7a005 Speed up TclOO init; no directing via unknown method handler for slots of classes we define ourselves 2025-08-19 09:00:02 +00:00
dkf 4a3783d6df Working on rewriting the slot implementation in C; not quite correct yet 2025-08-19 08:57:06 +00:00
jan.nijtmans 88f4b5757c Minor corrections, handle Tcl 9 platform reductions 2025-08-18 21:49:35 +00:00
jan.nijtmans 97e33af67f Oops, shouldn't use string compare here 2025-08-18 14:18:53 +00:00
jan.nijtmans a43258ca27 Let's not break it with Tcl 8.5 2025-08-18 14:08:34 +00:00
jan.nijtmans b166c166e7 Assume that - one day - MacOS 26.5 will be there 2025-08-18 13:56:44 +00:00
jan.nijtmans f963e96259 Update changes 2025-08-18 13:27:23 +00:00
jan.nijtmans aa6bf4e80b platform version => 1.0.20 2025-08-18 13:23:27 +00:00
jan.nijtmans fef64f5de5 Update "platform" for MacOS-26 (Tahoe). See [https://core.tcl-lang.org/tk/tktview/a91b242d43|a91b242d43] 2025-08-18 13:20:32 +00:00
jan.nijtmans ac81afab4f Fixed inconsistent indenting, introduced [0433b67adc|here]. See also [87b69745be] 2025-08-18 11:49:57 +00:00
dkf 111470b8a2 Slightly chisel down the execution time of the oo init script, 2025-08-18 11:39:40 +00:00
dkf 67c8c51001 Accelerate definition of [oo::define initialise]. [effa2e2346] 2025-08-18 08:56:11 +00:00
jan.nijtmans 4b52c0611f Merge 9.0 2025-08-18 08:32:47 +00:00
jan.nijtmans 8796676d52 Better not use the old octal notation (even though it still works) 2025-08-18 08:28:13 +00:00
dkf 3095406395 Start making TclOO faster to initialise [effa2e2346] 2025-08-17 21:22:29 +00:00
jan.nijtmans 8133abce26 Merge-mark 2025-08-16 22:00:45 +00:00
jan.nijtmans 66ce9bc185 Version => 8.6.18 2025-08-16 17:17:19 +00:00
jan.nijtmans db1368a130 Merge 9.0 2025-08-15 21:25:29 +00:00
jan.nijtmans 5f00348134 Merge 8.6 2025-08-15 21:19:13 +00:00
dgp 8061873d98 Merge release 2025-08-15 19:15:53 +00:00
apnadkarni 0548037236 Merge 9.0 - Fix [87b69745be] - move zipfs encoding initialization outside of interp creation. Avoid unnecessary file system epoch bump. 2025-08-14 13:44:47 +00:00
apnadkarni 6048f838e3 Fix [87b69745be] - move zipfs encoding initialization outside of interp creation. Avoid unnecessary file system epoch bump. 2025-08-14 13:32:20 +00:00
jan.nijtmans 2fd7fd7369 Merge 9.0 2025-08-13 21:10:28 +00:00
jan.nijtmans 2e55b5dd3a When compiling for Tcl 8.6, make Tcl 9-specific API unavailable. 2025-08-13 21:03:13 +00:00
dgp b522ab7c2a merge 8.6 2025-08-13 17:18:11 +00:00
jan.nijtmans 234032f005 Remove more references to version 8.7 2025-08-13 16:43:39 +00:00
apnadkarni 5c18029325 Merge core-9-0-branch 2025-08-13 13:52:45 +00:00
jan.nijtmans 2d7d8d6fd1 Merge 9.0 2025-08-13 10:57:00 +00:00
jan.nijtmans 4b6e6f5c2c Remove another check for TCL_MINOR_VERSION < 7 2025-08-13 10:38:41 +00:00
jan.nijtmans b099f09ec9 Version => 9.1a1 2025-08-13 09:42:53 +00:00
jan.nijtmans f2fa51ec73 Update changes.md 2025-08-13 08:57:05 +00:00
jan.nijtmans d282dddcfd Merge 9.0 2025-08-13 08:55:38 +00:00
jan.nijtmans e24b8208b0 Fix [31d4fa115b]: Tweak install permissions 2025-08-13 08:54:40 +00:00
jan.nijtmans 0056593b61 Merge 9.0 2025-08-12 22:05:07 +00:00
jan.nijtmans 71e90a29ad Merge 8.6 2025-08-12 22:00:05 +00:00
jan.nijtmans 20a3d4112f Fix [992f94d847]: avoid misaligned pointers in macOS file attribute functions 2025-08-12 21:51:30 +00:00
jan.nijtmans 4ba51a6b66 Merge 8.6 2025-08-12 14:43:59 +00:00
jan.nijtmans bb662c4f7a Update dde => 1.4.5. Don't worry about Tcl 8.7 any more 2025-08-12 14:25:16 +00:00
jan.nijtmans e82486aa49 remove tclUniData.c and uniParse.tcl: not used any more 2025-08-12 13:44:57 +00:00
jan.nijtmans 9ef1e66fba Fix doc: impotent font change 2025-08-12 13:09:40 +00:00
jan.nijtmans d702f1dcba Proposed fix for [31d4fa115b]: Tweak install permissions 2025-08-12 10:23:07 +00:00
jan.nijtmans c31f8caa4d Alternative proposed fix for [992f94d847]: avoid misaligned pointers in macOS file attribute functions 2025-08-12 10:03:34 +00:00
jan.nijtmans 5178c9fe83 Merge 9.0 2025-08-12 09:28:21 +00:00
jan.nijtmans a0b91a68d7 Merge 8.6 2025-08-12 08:57:28 +00:00
jan.nijtmans 4f6b05865f Update actions/checkout@v4 to actions/checkout@v5 2025-08-12 08:49:41 +00:00
jan.nijtmans 0e0db3eebb Backport some code formatting from 9.0. Fix sentinels 2025-08-12 08:46:15 +00:00
dkf 609c82da5e Factor out a common pattern to aid comprehensibility 2025-08-06 09:30:14 +00:00
apnadkarni e1d9fc8bc1 Only update file system epoch if system encoding changes 2025-08-06 02:17:47 +00:00
apnadkarni eb1fba12e2 Reintroduce TclpSetInitialEncoding for --disable-zipfs case 2025-08-06 02:06:11 +00:00
dgp 3912efe30f Bump to tcltest 2.5.10. Code has changed since 2.5.9 release. 2025-08-04 17:34:00 +00:00
sebres fadad8447c merge 9.0 (fix for [5137b4387019d0e1]) 2025-08-04 16:05:01 +00:00
dkf 3858e79861 Correction to semantics of jumpTableNum: value argument must fit in wide int, and non-integer is an error 2025-08-04 16:03:04 +00:00
sebres 4893e98712 fixes [5137b4387019d0e1]: ensure cache of base is correct for :localtime (system TZ) if TZ-env changing, especially if there is no registry;
clock.test: several tests rewritten as locale, timezone, environment (TZ, TCL_TZ) and also registry independent, also improved several setups/cleanups and usage of test-own registry - there are also no test failures by `-singleproc 1` anymore in clock.test;
2025-08-04 15:56:28 +00:00
sebres 70efeebc57 more tests to cover issue [5137b4387019d0e1] - ensure cache of base is correct for :localtime (system TZ) if TZ-env changing (if there is no registry) 2025-08-04 15:40:20 +00:00
dgp 3cf7de3328 unused variable warning 2025-08-04 13:32:52 +00:00
apnadkarni 8b2e59a8c8 Tweak test failing on macos to report macos result 2025-08-04 09:45:38 +00:00
dkf 1ae6a7c4d3 The encoding fallback logic in ZIP handling can be done mostly by via Tcl_ExternalToUtfDStringEx now. 2025-08-04 08:58:57 +00:00
apnadkarni 7c308a99f7 Re-fix [fccb9f322f]. Also eliminate bumping of file system epoch on every interp creation introduced in Tcl 9 2025-08-03 17:42:28 +00:00
apnadkarni 902548b5ec Proposed fix for [87b69745be]. Move search of zipfs to process initialization, not interp initialization 2025-08-03 15:22:47 +00:00
apnadkarni 0a57b1e0c7 Delete extraneous redundant line 2025-08-03 15:07:31 +00:00
apnadkarni 4d20eb490b Protect zipfs location with lock 2025-08-03 14:01:28 +00:00
apnadkarni b6b37b7c74 Delete dead code 2025-08-03 12:07:40 +00:00
apnadkarni 0da7d37ae9 Move search of zipfs to process initialization, not interp initialization 2025-08-03 11:38:46 +00:00
sebres 23a39ad85f (windows, noregistry only) invalidate base fields cache for TZ ":localtime", if TZ-epoch changed (without registry module and real TZ name, the local data epoch may be updated, but cache may contain offset of previos TZ, so ensure it'd be invalidated) 2025-08-01 11:59:34 +00:00
dgp fb7805683f Open release branch
Updates to the changes file.
2025-07-31 20:03:33 +00:00
sebres 3fe5d2c50d more informative result of test clock-38.2 (in failure case it'd output all 3 results of formats as subst of expr) 2025-07-31 17:08:47 +00:00
apnadkarni a37a480bf5 Add test for [87b69745be]. 2025-07-31 13:57:58 +00:00
sebres 7ccad65c74 clock.test: fixes bug [5137b4387019d0e1] (test clock with -singleproc 1); rewrite clock tests locale, timezone, environment (TZ, TCL_TZ) and also registry independent, also improve several setups/cleanups and usage of test-own registry 2025-07-31 13:43:47 +00:00
sebres b099048f89 tcltest: output begin/end timestamps locale independently (as ISO 8601 datetime), also it'd help to avoid side effects like [5137b4387019d0e1] (windows may need registry package to get system locale) 2025-07-31 13:37:02 +00:00
dgp cc1ea405b7 merge release 2025-07-30 18:36:48 +00:00
apnadkarni 25b0e9b76d Merge 9.0 - Workaround for [8c63606802] - testsetplatform / path caching with -singleproc 1 2025-07-30 16:23:17 +00:00
apnadkarni 5c1c118b8a Workaround for [8c63606802] - testsetplatform / path caching with -singleproc 1 2025-07-30 16:20:10 +00:00
dgp e1b559b602 merge trunk 2025-07-30 15:12:31 +00:00
apnadkarni 8f511d22c9 Merge 9.0. Fix some, not all, Windows test failures with -singleproc 1 2025-07-30 11:58:49 +00:00
apnadkarni 691d6c5fc0 Fix singleproc test failures for Windows 2025-07-30 11:38:10 +00:00
apnadkarni 1be1ad4d27 Fix test errors for -singleproc 1 runs on Windows 2025-07-30 10:26:34 +00:00
apnadkarni d6ef48a710 Update changes.md for TIP's 649 and 712 2025-07-30 09:01:58 +00:00
bch 3a52401ad2 comment grammar; NFC 2025-07-27 17:42:04 +00:00
apnadkarni bd24ad87ac Add manpage for unicode command 2025-07-27 17:28:32 +00:00
apnadkarni 559b1b2e28 Add manpage for normalization API 2025-07-27 08:41:24 +00:00
apnadkarni 985deea75b Add tests Tcl_UtfToNormalized API 2025-07-27 08:07:03 +00:00
apnadkarni 4da420a519 Add C API Tcl_UtfToNormalized 2025-07-27 00:59:37 +00:00
apnadkarni 19128173ab Merge tip-726-plus to eliminate use of tclUniData.c. 2025-07-26 06:14:54 +00:00
apnadkarni 875011d6f2 Fix test loading for mingw which uses tclsh, not tcltest for tests 2025-07-26 05:26:50 +00:00
apnadkarni da34f9f408 Fix gcc warnings, mingw build and extraneous prototype defs used in debug 2025-07-26 05:00:04 +00:00
apnadkarni 97bb071f95 Remove unicode toXXXX commands as no longer needed for confirming equivalence with string toXXXX 2025-07-25 17:55:29 +00:00
apnadkarni b2d6d22bf0 Eliminate use of tclUniData.c 2025-07-25 17:46:15 +00:00
dgp 09d76814f4 merge trunk 2025-07-25 17:43:24 +00:00
apnadkarni b66fac0f73 Implement unicode toXXXX congruent to string toXXXX 2025-07-25 17:34:27 +00:00
apnadkarni fd550b5cb8 Disable tests for bug 1ecea011 2025-07-25 16:05:25 +00:00
apnadkarni 88c4d1b817 Implement unicode is CLASS to match string is CLASS 2025-07-25 15:49:23 +00:00
apnadkarni cb86661230 Merged tip-726 2025-07-23 16:28:31 +00:00
apnadkarni 4fa79a7023 Merged trunk 2025-07-23 16:27:50 +00:00
apnadkarni 039786589f Test out of range codepoints 2025-07-23 16:07:38 +00:00
sebres 09489c384b merge 9.0: improve interpreter creation speed, if there is no zipfs tcl-library (avoid performance penalty [62019f8aa9f5ec73]) 2025-07-22 18:20:45 +00:00
sebres d7c57a0c14 improve interpreter creation speed, if there is no zipfs tcl-library (avoid performance penalty [62019f8aa9f5ec73]) 2025-07-22 18:18:41 +00:00
apnadkarni 0e4baeaa35 Oops, forgot upper case 2025-07-22 17:53:30 +00:00
apnadkarni a7943f6350 Add UCD tests for string is lower,upper. Add ICU and utf8proc API's for the same 2025-07-22 17:40:51 +00:00
apnadkarni 650bb69c7b Add support to read UCD properties file 2025-07-22 17:30:46 +00:00
apnadkarni 60f0a67594 Move UCD readers into separate file 2025-07-22 12:02:50 +00:00
apnadkarni a025151f2d Add normalization tests for nul and tcl8 profile. Fix linker warnings on Windows. 2025-07-22 10:40:26 +00:00
sebres 5c3426d524 merge 9.0 to trunk: amend to [61c01e0edb08a9ed], more cases for increment ref-count with use-after-free prevention for interim normalized path object; provide fixes minimally invasive (if API used with fresh created path object, so decrement would not destroy it if normalized path equal original given path) 2025-07-21 18:57:36 +00:00
sebres cb3067db94 merge 8.6 to 9.0: amend to [61c01e0edb08a9ed], more cases for increment ref-count with use-after-free prevention for interim normalized path object; provide fixes minimally invasive (if API used with fresh created path object, so decrement would not destroy it if normalized path equal original given path) 2025-07-21 18:54:00 +00:00
sebres 899a818f23 merge 8.5 to 8.6: amend to [61c01e0edb08a9ed], more cases for increment ref-count with use-after-free prevention for interim normalized path object; provide fixes minimally invasive (if API used with fresh created path object, so decrement would not destroy it if normalized path equal original given path) 2025-07-21 18:32:50 +00:00
sebres 970eb178b2 merge 9.0 to trunk: fixes [61c01e0edb08a9ed] (TclpMatchInDirectory, windows only), increment ref-count to avoid use-after-free for interim normalized path object, what may cause crash (SF/BO), usage of wrong path, etc. 2025-07-18 17:45:41 +00:00
sebres 135e331c3a merge 8.6 to 9.0: fixes [61c01e0edb08a9ed] (TclpMatchInDirectory, windows only), increment ref-count to avoid use-after-free for interim normalized path object, what may cause crash (SF/BO), usage of wrong path, etc. 2025-07-18 17:38:39 +00:00
sebres 9ff2ef9fe1 merge 8.5 to 8.6: fixes [61c01e0edb08a9ed] (TclpMatchInDirectory, windows only), increment ref-count to avoid use-after-free for interim normalized path object, what may cause crash (SF/BO), usage of wrong path, etc. 2025-07-18 17:29:45 +00:00
jan.nijtmans de58f61c2a Merge 9.0 2025-07-18 17:06:10 +00:00
jan.nijtmans 8fb869a726 Add check for working --disable-high-entropy-va. Fix check for --enable-auto-image-base (which always succeeded) 2025-07-18 17:02:29 +00:00
jan.nijtmans 635ba5bd14 Add check for working --disable-high-entropy-va. Fix check for --enable-auto-image-base (which always succeeded) 2025-07-18 11:52:06 +00:00
jan.nijtmans e499be71f0 Add check for working --disable-high-entropy-va. Fix check for --enable-auto-image-base (which always succeeded) 2025-07-18 09:52:12 +00:00
jan.nijtmans 9feb99ecb1 Fix 2 warnings on 32-bit platform (thanks, Emiliano) 2025-07-18 07:37:28 +00:00
dgp 06740b2fe5 merge trunk 2025-07-17 15:36:57 +00:00
jan.nijtmans 78cb74134b Fix installation of dde/registry packages (Thanks, Harald, for noticing this!) 2025-07-17 07:59:16 +00:00
jan.nijtmans c1432f0462 Merge 9.0 2025-07-17 07:47:44 +00:00
jan.nijtmans db32da8682 Merge 8.6 2025-07-17 07:41:05 +00:00
jan.nijtmans a8a1f62999 Fix [https://core.tcl-lang.org/tk/info/06892c6e12|06892c6e12]: loading windows dll's in Cygwin doesn't work with high-entropy-va 2025-07-17 07:15:30 +00:00
apnadkarni 5af2155539 Merge 9.0 - Fix [c9f0520f7e] 2025-07-16 16:44:34 +00:00
apnadkarni c9498e0b05 Merge 8.6. Fix [c9f0520f7e] - Tcl_SplitList memory size computation overflow. No test because not practical to overflow Tcl_Size on 9.0. 2025-07-16 16:26:59 +00:00
apnadkarni 7fe677cf6b Fix [c9f0520f7e] - Tcl_SplitList memory overflow overwrite 2025-07-16 15:26:05 +00:00
apnadkarni 71581e9afa Check interp for NULL before storing error! 2025-07-16 11:26:46 +00:00
apnadkarni 4882c7bc07 Merge 8.6 2025-07-16 10:49:49 +00:00
apnadkarni dde6018798 Add tests for C API 2025-07-16 04:53:02 +00:00
dgp 21d149f5e9 merge trunk 2025-07-15 16:35:37 +00:00
apnadkarni dc7f50b812 TIP 726 implementation with tests 2025-07-15 11:41:33 +00:00
jan.nijtmans 6fb310bb09 Merge 8.6 2025-07-15 10:25:46 +00:00
jan.nijtmans 45f4c1b34e 2 minor comment fixes 2025-07-15 10:21:13 +00:00
jan.nijtmans 4562b6d22c Minor review comment (since 8.6 still uses ckfree) 2025-07-15 10:14:35 +00:00
apnadkarni 0dee7bed88 Proposed fix for [c9f0520f7e] Tcl_SplitList crash. 2025-07-15 03:31:20 +00:00
apnadkarni f4a5ba54ac Fix [25265a2705] - dup test names in listTypes.test 2025-07-15 02:31:28 +00:00
apnadkarni b1ac90a4a8 Implement Tcl_UtfToNormalizedDString 2025-07-14 16:44:26 +00:00
jan.nijtmans 1528383bf1 Backout [816e9ddf1b]: TclVarHashCreateVar() is still used in Itcl 2025-07-14 15:31:08 +00:00
dgp e6d42cbc43 Open release branch for 9.1a0 2025-07-14 12:30:56 +00:00
jan.nijtmans f9d43f296c Doc update. See [8cd74c5cd2] 2025-07-13 08:30:48 +00:00
jan.nijtmans c3ceb84d68 Doc update. See [8cd74c5cd2] 2025-07-13 08:02:35 +00:00
jan.nijtmans 23015fefad Doc update. See [8cd74c5cd2]. Backport more doc improvements from 9.1 2025-07-13 07:51:22 +00:00
jan.nijtmans b9b2db3c5f [8cd74c5cd2]: 2-argument string toupper/tolower/totitle doesn't work as documented. Either change the documentation, or the implementation. Both are done in this commit (but only one of them should be merged to trunk) 2025-07-12 16:42:09 +00:00
apnadkarni 0b12aaa081 Start on TIP 726. Add utf8proc to the build system 2025-07-12 16:03:14 +00:00
jan.nijtmans 01ff23f34d Some int -> Tcl_Size modifications, and type-cast changes, which were missed up to now. 2025-07-10 11:50:06 +00:00
jan.nijtmans 8727b0b49a Related to [bdaf890168]: Use Tcl_Size in stead of int while using TclParseAllWhiteSpace() 2025-07-09 12:31:12 +00:00
apnadkarni 6e5503565e Fix [f8dd3d8d35]. Memory leak in uplevel compile 2025-07-08 14:23:55 +00:00
apnadkarni 51f172a42a Proposed fix for [f8dd3d8d35]. Memory leak in uplevel compile. 2025-07-08 02:58:56 +00:00
apnadkarni 0f6435157f TIP 649 2025-07-05 09:36:47 +00:00
apnadkarni f6bf9def7e Merge trunk 2025-07-05 06:05:51 +00:00
jan.nijtmans b01a4e6bd3 Merge 9.0 2025-07-03 11:59:16 +00:00
jan.nijtmans 1a3d7da175 Version -> 9.0.3 2025-07-03 11:57:22 +00:00
jan.nijtmans b4169bc203 Fix [6b8e39e83]: On Unix, IsTimeNative() always defined but not always used 2025-07-03 10:42:21 +00:00
jan.nijtmans 1d58e7eba2 Merge 9.0 2025-07-03 09:20:53 +00:00
jan.nijtmans 4e8007f55d Merge-mark 2025-07-03 08:11:40 +00:00
dgp e4f4cb135c merge release 2025-07-02 15:16:16 +00:00
dgp 0cb9c0b3f8 merge 9.0 2025-07-01 17:28:51 +00:00
dgp 66c3ad95b6 Edits to the changes file 2025-07-01 15:23:13 +00:00
oehhar 4073788a7e [0cb3d93a] fix example in link documentation 2025-07-01 07:56:25 +00:00
oehhar ed50905900 [0cb3d93a] fix example in link documentation 2025-07-01 07:55:02 +00:00
dgp 2a51e8e640 Note the new releases of bundled packages in the changes. 2025-06-30 21:23:58 +00:00
dgp cb357cc4bf merge 9.0 2025-06-30 20:11:39 +00:00
dkf 99cd5e5444 Make some internal magic flags into an enum. Nobody will ever override these. 2025-06-30 14:59:32 +00:00
jan.nijtmans 8f6b586b58 Unbreak build with clang, introduced in last few commits 2025-06-29 19:38:44 +00:00
dkf 934c9819c7 Add bytecode compilation of [uplevel] 2025-06-29 06:36:50 +00:00
dkf e634d18c48 merge trunk 2025-06-29 06:25:43 +00:00
dkf 7ec3df7ddd Add bytecode compilation of [lseq] 2025-06-29 06:21:24 +00:00
dkf cb435cd742 Add bytecode compilation of [ledit] and [lpop] 2025-06-29 06:09:32 +00:00
apnadkarni 8678f0ba6a Merge 9.0. Fix test exec-bug-4f0b5767ac error when MSYS scrubs PATH 2025-06-28 10:47:53 +00:00
apnadkarni 269d6061c3 Fix test exec-bug-4f0b5767ac error when MSYS scrubs PATH 2025-06-28 10:45:43 +00:00
jan.nijtmans cb6415b2d5 Merge 9.0 2025-06-27 15:41:21 +00:00
jan.nijtmans 34630d5ca1 Fix [9dfae3413d]: interp limit commands still seems to be 32 bits 2025-06-27 15:28:01 +00:00
jan.nijtmans b50a64424f Fix [ef7042075c]: tcl::build-info not documented 2025-06-27 15:20:01 +00:00
dkf 72ab4731bf merge trunk 2025-06-27 10:55:20 +00:00
dkf 93c204b162 merge trunk 2025-06-27 10:53:43 +00:00
dkf ee4c12f1b4 merge trunk 2025-06-27 10:50:43 +00:00
dkf 5142b5748e All test cases now pass. 2025-06-27 10:50:11 +00:00
jan.nijtmans 5d75a1e629 Merge 9.0 2025-06-27 08:34:44 +00:00
jan.nijtmans 662d103e7d doc fix 2025-06-27 08:12:13 +00:00
dkf 0d4d978c52 Some of the test failures fixed... 2025-06-27 08:03:03 +00:00
apnadkarni 5721de48ca Make exec-bug-4f0b5767ac test independent of locale 2025-06-27 07:45:18 +00:00
jan.nijtmans bb3e4af18d Make all references to -DFOO compiler flags bold in documentation 2025-06-27 07:16:03 +00:00
dgp e41cc9b99b merge 9.0 2025-06-26 14:51:57 +00:00
dkf ce70b3ebe4 Compiled [uplevel] works. Except for some tests which see differences in [info frame] as a result. 2025-06-26 14:28:29 +00:00
jan.nijtmans dc55749c58 Merge 9.0 2025-06-26 13:46:33 +00:00
jan.nijtmans af368b9049 Document what happens for non-documented field values 2025-06-26 13:38:36 +00:00
dgp b824cdafec [27fa01a7db] Restore default option to [namespace which] implementation. 2025-06-26 13:19:43 +00:00
dkf 6c2dedfaa4 Draft of instruction done... but crashes. 2025-06-26 13:12:02 +00:00
jan.nijtmans 9e7c74bb55 Merge 9.0 2025-06-26 11:15:59 +00:00
jan.nijtmans 55777cb64d Make everthing compile (again) and run with a C++ compiler. 2025-06-26 11:14:11 +00:00
dkf 89b3243fd8 Start of developing compilation for [uplevel] 2025-06-26 10:45:06 +00:00
dkf 9cd8ebbfe8 mark some more commands for future expansion consideration 2025-06-26 10:32:07 +00:00
jan.nijtmans ad4985397d Merge 9.0 2025-06-26 09:56:50 +00:00
jan.nijtmans ecd951296b tclWinPipe.c:3427:12: warning: unused parameter ‘wakeEvent’ [-Wunused-parameter] 2025-06-26 09:55:11 +00:00
jan.nijtmans bc62e73bb8 @dkf's review comments (Thanks!) 2025-06-26 08:48:02 +00:00
jan.nijtmans d5ba2b9a38 Fix Tcl_LimitGetCommands() signature (int -> Tcl_Size) 2025-06-26 08:03:33 +00:00
jan.nijtmans c708a47b25 Fix [9dfae3413d]: interp limit commands still seems to be 32 bits 2025-06-26 07:59:27 +00:00
dkf daa1e38bab merge trunk 2025-06-26 07:56:35 +00:00
dkf 2426c3bd63 Change bytecode flag names to match their related instruction 2025-06-26 07:53:31 +00:00
jan.nijtmans d84809538f [ef7042075c]: tcl::build-info not documented 2025-06-26 07:35:48 +00:00
apnadkarni d832d24006 Merge 9.0 - Fix [40b1814b93] and [7c2716733a] Window handle use-after-frees. 2025-06-25 16:41:27 +00:00
apnadkarni ea836428c1 Fix [7c2716733a] - use after free on Windows pipe handles 2025-06-25 16:23:23 +00:00
apnadkarni afdd41dd6a Fix [40b1814b93] - use after free on TSD in Winsock 2025-06-25 15:48:13 +00:00
dkf 8b9e2d4583 Better disassembly of [lpop]-related flag argument 2025-06-25 13:46:01 +00:00
dgp e6fdf643b3 merge 9.0 2025-06-25 13:44:07 +00:00
jan.nijtmans b90ddeb75c Merge 9.0 2025-06-25 12:20:30 +00:00
jan.nijtmans b264aa7c57 Merge-mark 2025-06-25 12:04:48 +00:00
jan.nijtmans 2e36c3e97b Fix [ecafd8611d]: Euro/Tail-sign missing from cp864 encoding 2025-06-25 11:15:53 +00:00
dkf 3b5e99739b Better argument processing order in [lpop] compiler. Not necessary, but nicer to read 2025-06-25 09:10:40 +00:00
dkf f1d8f0a503 Handle non-trivial single indices in [lpop] compiler 2025-06-25 07:25:04 +00:00
apnadkarni 7b258bd47c Merge 9.0 2025-06-25 03:29:27 +00:00
apnadkarni 7b458b0a03 Merge 9.0 2025-06-25 03:09:52 +00:00
dkf 17437636cb merge trunk 2025-06-24 20:18:46 +00:00
dkf 3c192328ca Better compilation of [ledit]. Still not convinced about refcount management 2025-06-24 20:16:41 +00:00
dgp 214cce5517 merge 9.0 2025-06-24 16:55:07 +00:00
dgp dcb9cf19bb merge 9.0 2025-06-24 16:35:48 +00:00
dgp 86070b6f26 [ecf35c7120] Correct nested handling of return option -options 2025-06-24 16:23:04 +00:00
dkf a46ef482b3 Note about variable ordering 2025-06-24 08:11:43 +00:00
dkf a570556b6e Add [ledit] compilation, tweak safety conditions in [lpop] compiler 2025-06-24 08:02:26 +00:00
dgp cc4e06ba60 [ecf35c7120] Pending fix for nested -options processing. 2025-06-23 19:58:15 +00:00
dgp 9631a6e074 Two more tests demonstrating the inconsistency between processing
-options {...} to emulate {*} argument expansion and processing
according to the behavior of dictionaries and how [dict create] combines
its arguments, notably how it handes duplicate keys.

This is exposed by nested -options, because the outer processing handles
in one way, while the nested processing handles in the other way.
2025-06-23 17:36:21 +00:00
dkf 24a53e6920 Move test to runtime, check enabled by new flag bit to INST_LREPLACE 2025-06-23 16:17:42 +00:00
dkf 1b050f07c1 Add in test for index-in-range. Not enough... but fixes some test cases. 2025-06-23 16:04:28 +00:00
dkf 209a4cd4ff Tweak tests; still test the same thing, but more succinctly 2025-06-23 14:55:41 +00:00
dkf 0ae1b02c78 improve tests: run in procedure context as well as outside 2025-06-23 11:33:13 +00:00
dkf 7ad8f9bfd7 Partial compilation of [lpop]; missing error handling 2025-06-23 11:14:19 +00:00
dkf 2d48fa2684 Mark some commands as needing bytecode compilation. Capitalise some function names to follow Tcl style 2025-06-23 07:39:13 +00:00
dkf c8a2ab1879 Move code that might work to shared place, and delete copy that definitely won't ever work 2025-06-23 07:26:33 +00:00
dkf b20c1053ab merge trunk 2025-06-23 06:57:16 +00:00
dkf 6c81bff536 Make [yieldto] work with {*}; turns out no new opcodes were needed, just a test for a previously-impossible case 2025-06-22 13:52:20 +00:00
apnadkarni e8b57cc705 Merge trunk 2025-06-22 08:44:53 +00:00
apnadkarni 636cda54f0 Avoid repetion in manpage 2025-06-22 08:43:51 +00:00
apnadkarni 8a631b4d12 Update manpages for TIP 649 2025-06-22 08:39:08 +00:00
apnadkarni ea30a47ef4 Better limit exceeded message 2025-06-22 05:01:21 +00:00
apnadkarni f981dcbe94 Clean up comments 2025-06-22 03:17:40 +00:00
apnadkarni 8e85d70b91 Use list limit error reporting function 2025-06-22 02:43:25 +00:00
dkf 0d3b650a17 merge trunk 2025-06-21 10:31:46 +00:00
dkf 8db5a8ae20 Make the bytecode compilation of [next] and [nextto] understand {*} in arguments. 2025-06-21 10:29:29 +00:00
apnadkarni 1b671ec0dd Update two tests - lassign will no longer shimmer abstract lists even if they lack a slice method 2025-06-21 10:10:47 +00:00
apnadkarni 66cd404c19 Merge trunk 2025-06-21 09:46:28 +00:00
dkf aa73ee6e56 Better express intent of a cast 2025-06-21 08:06:26 +00:00
dkf 16c428e8b9 merge trunk 2025-06-21 07:57:19 +00:00
dkf 624802c0f3 merge trunk 2025-06-21 07:56:31 +00:00
dgp 4b07d6b1e2 [ecf35c7120] Test for the bug. Open branch for fixing. 2025-06-20 17:24:27 +00:00
dgp 480e15a41c silence compiler warning 2025-06-20 17:14:08 +00:00
apnadkarni beb9469222 Merge 9.0. Fix [e8b18d7b1f] - release encodings on error 2025-06-20 16:05:22 +00:00
apnadkarni f1a3e189ec Fix [e8b18d7b1f] - release encodings on error 2025-06-20 16:00:23 +00:00
dkf 44b80fc8ad Clean up aux data correctly on failed compile [c587295271] 2025-06-20 15:51:53 +00:00
apnadkarni 68c9014a4a Partial fix for [c587295271] memory leak in TclCompileTryCmd 2025-06-19 16:14:57 +00:00
dkf 84be74fba6 Move general variable compiler to file where it makes sense 2025-06-19 14:08:10 +00:00
dkf baec983c04 Make more assoc-data keys into named defines, for greater mnemonicity 2025-06-19 13:52:17 +00:00
apnadkarni fea176b546 Start on [e8b18d7b1f] fix. 2025-06-18 18:12:18 +00:00
apnadkarni 7b90822271 Merge 9.0. Fix [4f338b91c1] - add missing Tcl_CloseEx docs 2025-06-18 17:39:32 +00:00
apnadkarni 19591e2473 Merge 8.6. Fix [4f338b91c1] - add missing Tcl_CloseEx docs 2025-06-18 17:34:31 +00:00
apnadkarni 875729efc9 Fix indent 2025-06-18 17:14:34 +00:00
apnadkarni 2aabb685b6 Merge trunk 2025-06-18 15:55:09 +00:00
jan.nijtmans 1b654bc947 Fix indenting/eol-spacing 2025-06-18 11:22:09 +00:00
dkf dc52697066 tidy up some list related code; no functionality change 2025-06-18 10:48:30 +00:00
dgp 5aff1b51d1 merge 9.0 2025-06-17 16:28:01 +00:00
dgp b55915dc2d merge 9.0 2025-06-17 16:27:34 +00:00
dgp ec6493f2b8 [da5e1bc7bc] exec channel not closed on errors 2025-06-17 16:06:02 +00:00
oehhar 74867b094c Update macOS info in README.md and macosx/README 2025-06-17 14:52:15 +00:00
culler 5c21ccca7b Update macOS info in README.md and macosx/README 2025-06-17 13:35:58 +00:00
max dab38fe514 TIP 712 - Add "positive" options to the subst command 2025-06-17 12:27:48 +00:00
dkf 28aca7303b merge trunk 2025-06-17 10:17:49 +00:00
dkf 43cbca4fbf Make ParseArithSeriesArgument slightly better 2025-06-17 08:57:47 +00:00
dkf 01cd0a0e45 Reduce number of gotos (and general twistiness) in GenerateArithSeries 2025-06-17 08:51:10 +00:00
dkf d5fb294747 Move most of INST_ARITH_SERIES logic into a separate function. Much easier to understand that way. 2025-06-17 08:19:17 +00:00
apnadkarni f07a0838c2 Bug [da5e1bc7bc] - exec channel not closed on errors 2025-06-17 04:26:54 +00:00
dgp 94b7fc5ca7 makeFile hygiene 2025-06-16 19:04:20 +00:00
dgp 99d97ce43f Dup test name 2025-06-16 19:01:44 +00:00
dgp 7278dc8cbc Open release branch for Tcl 9.0.2 2025-06-16 17:50:22 +00:00
dkf 3de98b6fb6 Add compilers for expanding [next] and [nextto] 2025-06-16 16:02:11 +00:00
dkf b38f2f3429 Neater comment 2025-06-16 11:54:09 +00:00
dkf cea3281fa1 Use function we have in other appropriate places 2025-06-16 11:52:14 +00:00
dkf b537b155ed more cleaning up of the way [next]'s bytecode works 2025-06-16 11:43:35 +00:00
dkf ccdaf5990b Start of {*}-aware [next] and [nextto] 2025-06-16 10:41:48 +00:00
apnadkarni bd808f7dcc Fat fingers in constraints 2025-06-15 10:15:48 +00:00
apnadkarni 5e3100e225 Merge 9.0 - tests for handle leaks for exec 2025-06-15 03:03:13 +00:00
apnadkarni e88b3c601b Add tests to check handle leaks for exec 2025-06-15 03:01:46 +00:00
apnadkarni 38808ad999 Bug [7c2716733a] - use after free on Windows event handle 2025-06-14 13:59:53 +00:00
apnadkarni a01dee70ea Disable additional tests under App Verifier - timing or locale do not work with it 2025-06-14 13:59:08 +00:00
apnadkarni 11ab70fd89 Merge 9.0 - Disable timing dependent tests when running under AppVerifier on Windows 2025-06-14 11:50:26 +00:00
apnadkarni 1dfad0a9d3 Merge core-9-0-branch 2025-06-14 11:44:45 +00:00
apnadkarni d24753dbf1 Disable timing dependent tests when running under AppVerifier on Windows 2025-06-14 11:40:33 +00:00
apnadkarni 1958ac85c0 Bug [40b1814b93] - Proposed fix for Winsock use-after-frees 2025-06-14 05:31:49 +00:00
apnadkarni 6ad83f332d Merge 9.0 - Add testhandlecount command. 2025-06-14 03:29:29 +00:00
apnadkarni 995249252e Add testhandlecount command to check Windows handle leaks 2025-06-14 03:25:33 +00:00
dkf c7a571a771 merge trunk 2025-06-13 13:32:43 +00:00
dkf 0cf8975e2a Implement [tailcall {*}...] in bytecode 2025-06-13 13:27:53 +00:00
dkf a367c2d812 Add new macro, EnvIsProc, to cover cases where we should be stricter. [fa7995bdf2] 2025-06-13 08:14:31 +00:00
dkf 7b34cb4a15 [fa7995bdf2] Add more direct test case for real bug 2025-06-13 07:46:41 +00:00
dkf c6afdfc531 Move magic values into header file 2025-06-13 07:22:59 +00:00
dgp 6cc142428e [fa7995bdf2] End multiple segfaults in httpcookie.test. 2025-06-12 15:08:52 +00:00
dkf 24f8828f4d merge trunk 2025-06-12 08:58:07 +00:00
dkf a7346777c6 Make sure there are no memory leaks in the arithSeries operation 2025-06-11 12:41:08 +00:00
dkf 082bbbea10 All edge case tests now pass. But why does [lseq] behave like this??? 2025-06-11 11:00:04 +00:00
dkf f748950db6 More edge cases 2025-06-11 08:45:36 +00:00
dkf 304456608e final cases 2025-06-10 16:28:27 +00:00
dkf 3ab0bb6501 Handle the three-argument cases 2025-06-10 16:07:17 +00:00
dkf b4b10b99d7 And I already have the right tools to make this easy. Excellent. 2025-06-10 15:32:47 +00:00
dkf ce74537dd7 Add compilation of two arg case... and note that we need to compile args as expressions 2025-06-10 15:25:41 +00:00
jan.nijtmans da8d758711 Merge 9.0 2025-06-10 15:12:44 +00:00
dkf e7cf3a048c Basic [lseq] compiler that handles just the one case. 2025-06-10 15:12:43 +00:00
dkf 401ff4964c Name the operation's flag bits 2025-06-10 15:00:42 +00:00
jan.nijtmans 76f4308926 Fix [0ee626dfb2]: lseq numeric overflow 2025-06-10 14:18:14 +00:00
dkf abc2391b16 Define an instruction to build an arithmetic series. Not yet issued 2025-06-10 13:53:59 +00:00
dkf 077a6cbece Outermost skeleton of [lseq] compiler. Much more still to do! 2025-06-10 11:38:33 +00:00
dkf 6cdf0568cf Tinkering with the ArithSeries object type implementation 2025-06-10 11:34:13 +00:00
jan.nijtmans 4bdb2c7b6e Fix [b876737a0b]: tcl::tm::path doesn't handle tilde expand 2025-06-10 11:34:07 +00:00
jan.nijtmans 791b296b8e Let the caller of ::tcl::tm::roots do the [file tildeexpand] 2025-06-10 10:56:07 +00:00
dkf 7d0bbc47d7 Delete code that caused failures with -ftrapv and otherwise did nothing useful 2025-06-10 09:08:23 +00:00
dkf f6627105c2 Remove unused argument 2025-06-10 08:41:00 +00:00
dkf be130b0337 Convert defines to enums in remaining Windows-specific code 2025-06-10 07:53:06 +00:00
jan.nijtmans 40c5514475 Backport github ACTIONS build scripts from Tcl 9.1 2025-06-09 19:08:03 +00:00
jan.nijtmans 62d918cae7 Fix for [b876737a0b]: tcl::tm::path doesn't handle tilde expand 2025-06-09 16:55:39 +00:00
jan.nijtmans 8ebcf55a9f Merge 8.6 2025-06-09 13:58:21 +00:00
apnadkarni cd3de32c6b Merge core-9-0-branch. Pick up fix for [0ee626dfb2] and other sundry unmerged changes 2025-06-09 13:41:41 +00:00
apnadkarni 36db921e01 Fix [0ee626dfb2] - lseq numeric overflow 2025-06-09 13:17:48 +00:00
jan.nijtmans e569e9e9ab Indenting 2025-06-09 11:17:54 +00:00
dkf c34088c42a Greatly improved [tailcall] handling, including more special cases. 2025-06-09 08:18:09 +00:00
apnadkarni 1b6a0ff3b0 Clarify in manpage that lseq can produce doubles 2025-06-09 06:03:26 +00:00
apnadkarni 31181a01b6 Merge trunk 2025-06-09 05:34:19 +00:00
apnadkarni 08f8cf1a9e Bug [0ee626dfb2] - arithseries integer overflow checks 2025-06-08 12:02:53 +00:00
dkf 2ea0874f3f merge trunk 2025-06-08 11:58:01 +00:00
apnadkarni 2d357d6e45 Add test cases 2025-06-08 11:34:21 +00:00
dkf 502fec899c Fix error 2025-06-08 11:30:01 +00:00
apnadkarni 1d7632f6e0 Create new branch named "bug-0ee626dfb2" 2025-06-08 11:18:31 +00:00
apnadkarni 9ca9c5016b Added memory leak tests for Tcl_ListObj* 2025-06-07 16:08:16 +00:00
apnadkarni ee9184e1a9 Add Tcl_ListObjReverse tests 2025-06-07 15:17:36 +00:00
apnadkarni c4db257e2e Tests for Tcl_ListObjRepeat 2025-06-07 07:55:43 +00:00
jan.nijtmans 7c6afac7e6 Fix [2bf9fbcb99]: Tcl 9 docs outdated regarding tcl_platform(threaded) 2025-06-06 22:34:11 +00:00
apnadkarni f1d660fcb3 Start on TIP 649 tests. Also fix [5773c78e86]. 2025-06-06 16:55:52 +00:00
dkf 98d42037a5 merge trunk 2025-06-06 14:58:31 +00:00
dkf 326bfdff35 give tests human-readable names 2025-06-06 13:54:51 +00:00
dkf de6f149f5f fix silly capitalisation error 2025-06-06 13:33:10 +00:00
dkf 48c4185146 After private testing, this works correctly and is shorter too 2025-06-06 13:29:37 +00:00
dkf 0eb53a0627 [9a2351225c] Alternate, portable way of testing for [foreach] and [lseq] interacting badly 2025-06-06 08:39:54 +00:00
dkf 370566c1e6 That script can be used on the other two platforms too. Excellent! 2025-06-06 08:28:16 +00:00
dkf dfa4a65a52 Move support Tcl script into its own file 2025-06-06 08:24:34 +00:00
apnadkarni 24d8781502 Add new list functions to stubs 2025-06-06 05:49:35 +00:00
apnadkarni e2ce695c5d Start on TIP 649 2025-06-05 13:49:37 +00:00
dkf 3170aa3764 Don't need to save the value from the subprocess in a variable 2025-06-05 12:49:07 +00:00
dkf 114535264c Alternate way of testing for no memory bloat in foreach+lseq; should be cross-platform and MUCH less sensitive to configuration 2025-06-05 08:42:11 +00:00
dkf 35dc38b268 rewrite test to use a constraint instead of a silly result condition 2025-06-05 08:17:53 +00:00
jan.nijtmans d4406723ec Check for tag "core-*", not "core-**" everywhere the same 2025-06-05 08:12:05 +00:00
dkf b9f37656c8 Correct syntax error in github action command files 2025-06-05 08:02:41 +00:00
dkf d554c361d3 Reduce size of build matrices for non-critical commits. This needs deeper Github Actions wizardry. 2025-06-04 10:51:44 +00:00
jan.nijtmans e0792c933b Merge 9.0 2025-06-04 10:28:41 +00:00
jan.nijtmans b4f22927e5 fix leak in lseq.test 2025-06-04 10:21:51 +00:00
jan.nijtmans 1978e5ad54 Simplify tcl::build-info parsing for testConstraint's 2025-06-04 07:54:00 +00:00
apnadkarni 08fa057f64 Update changes.md for TIP's 711, 716, 717 2025-06-04 03:26:53 +00:00
apnadkarni a9d4c8d1cd TIP 716 - add stub for Tcl_GetEncodingNameForUser 2025-06-04 03:11:35 +00:00
dkf d0020e0e23 Make the [tailcall] compiler understand {*}; a common case 2025-06-03 15:16:07 +00:00
apnadkarni 5cced2c4ac Test Tcl_GetEncodingName* functions callable via stubs 2025-06-03 05:00:27 +00:00
apnadkarni a331adea33 Add stubs function from TIP 716 2025-06-03 03:34:57 +00:00
jan.nijtmans ba9e9a59a9 rebase to trunk 2025-06-02 15:52:36 +00:00
apnadkarni 6e5baa7e71 Merge mark 2025-06-02 15:45:38 +00:00
apnadkarni 327160f25e Update changes.md for TIP 716 2025-06-02 15:38:43 +00:00
jan.nijtmans 69a513d135 Merge-mark 2025-06-02 15:37:50 +00:00
jan.nijtmans 56ec7b2901 Backport: Add [[unreachable]] and [[fallthrough]] from C23 (where available) 2025-06-02 14:18:14 +00:00
apnadkarni d99e33e348 Merge core-9-0-branch: TIP 716 accepted 2025-06-02 12:42:50 +00:00
apnadkarni f145c7fbd2 TIP 716 accepted 2025-06-02 12:07:31 +00:00
dkf 9534c91a41 Upgrade [lappend] so it bytecode compiles directly with expansion of arguments 2025-06-02 11:54:46 +00:00
dkf 810f50427c Ensure we never concatenate too many values at once 2025-06-02 11:42:02 +00:00
dkf 97d5fe7c2b merge trunk 2025-06-02 11:24:58 +00:00
dkf 3f43b4f84e Use correct variable name... 2025-06-02 08:52:39 +00:00
apnadkarni 923be72f83 Cherrypick 57d619a23f - Jan's changes for unused vars 2025-06-01 18:13:01 +00:00
apnadkarni 700440e0f3 Merge core-9-0-branch 2025-06-01 15:32:38 +00:00
dkf 7d59bf0f64 Add [[unreachable]] and [[fallthrough]] from C23 (where available) 2025-06-01 10:24:33 +00:00
dkf 3f8091f15a Should set variable earlier 2025-05-31 08:13:16 +00:00
dgp 8e0716b082 [9a4876e887] Get ooWhat initialized before any error handling paths. 2025-05-30 19:35:52 +00:00
dgp 1eb17e0903 silence compiler warning 2025-05-30 19:14:02 +00:00
dgp 14c5e416e3 [fa7995bdf2] Stop crash in [http::cookiejar create]. 2025-05-30 18:55:57 +00:00
dkf 2e70d1dbe5 merge trunk 2025-05-30 14:17:53 +00:00
dkf d8ceb92fcc Minor refactor of some parts of TclOO code 2025-05-30 14:00:04 +00:00
dkf ddd949b958 Another switch that can be marked explicitly as exhaustive 2025-05-30 13:35:28 +00:00
dkf 780e40c538 Workaround for Clang being obnoxious 2025-05-30 08:28:08 +00:00
dkf c939f74973 Don't read uninitialised memory; store in TEBCdata instead 2025-05-29 20:26:35 +00:00
dkf 6e2188ef57 Go back to other way of working; actually more efficient in this case 2025-05-29 15:18:39 +00:00
dkf ebff9819e9 merge trunk 2025-05-29 15:10:40 +00:00
dkf c4d746554b put back accidentally removed code 2025-05-29 15:07:03 +00:00
dkf dfa5717634 Apple's clang-pretending-to-be-gcc is slightly fussy 2025-05-29 08:17:45 +00:00
dkf 14e9c92103 more unreachable/fallthrough marks 2025-05-29 08:13:56 +00:00
dkf 5f4f0bf1e6 More marking of paths as unreachable 2025-05-27 19:11:46 +00:00
dkf deb0e4ee28 Add a TCL_UNREACHABLE macro for marking a code path as never reached
Inspired by https://en.cppreference.com/w/c/language/attributes/deprecated
2025-05-27 11:28:24 +00:00
apnadkarni 59040bcaaa Merge 9.0. Disable unsupported icu tests for valgrind as dl_load of icu muddies valgrind output 2025-05-27 05:02:21 +00:00
apnadkarni a6a2d6ced9 Disable unsupported icu tests for valgrind as dl_load of icu muddies valgrind output 2025-05-27 05:01:08 +00:00
apnadkarni 5303e4fc8c Proposed fix for memory leak in TclCompileTryCmd 2025-05-27 03:23:54 +00:00
jan.nijtmans 010caf4f10 Add some more Tcl_Attempt* functions 2025-05-26 12:59:04 +00:00
apnadkarni beea64e0dc Merge mark for 9.0 changes.md 2025-05-26 11:59:46 +00:00
apnadkarni 5c2cca7db2 Update changes for fixed tickets 2025-05-26 11:56:49 +00:00
jan.nijtmans 5637219381 Merge 9.0 2025-05-26 11:48:29 +00:00
apnadkarni 58b76f95b2 Update changes.md 2025-05-26 11:47:06 +00:00
jan.nijtmans 7a6af69ba8 Update changes.md 2025-05-26 11:41:49 +00:00
apnadkarni 6b4720e854 New internal list representations for lreverse, lrepeat, lrange. See https://core.tcl-lang.org/tcl/wiki?name=New+abstract+list+representations 2025-05-26 11:40:37 +00:00
jan.nijtmans 72c2ffce20 Fix [1dcda0e862]: Build broken (trunk branch) tclCompExpr.c tclOOCall.c. Just by disabling the warning. 2025-05-26 11:40:28 +00:00
jan.nijtmans 352041bd83 Indenting (backported from 9.1) 2025-05-26 11:37:48 +00:00
apnadkarni 7778d0116c Merge trunk 2025-05-26 11:10:26 +00:00
apnadkarni 3ea2a44644 Merge 9.0 - Fix [7346adc50f] - memory runaway on truncated iso2022 encoding 2025-05-26 10:31:22 +00:00
apnadkarni 0ce06d0a65 Fix [7346adc50f] - memory runaway on truncated iso2022 encoding 2025-05-26 10:29:00 +00:00
jan.nijtmans efc03cf36f Use TclAttemptInitStringRep() in a few more places where it's possible. Fix indenting. 2025-05-26 10:04:29 +00:00
apnadkarni 9087f55082 Add table driven truncation at end test 2025-05-26 06:12:50 +00:00
apnadkarni c4618712a0 Handle tcl8 and replace profiles for truncated escape encodings. Add tests. 2025-05-26 05:12:10 +00:00
apnadkarni 5d722018ba Start on [7346adc50f]. Now raise error on truncated encoding. Still have to handle replace and tcl8 profiles. 2025-05-25 17:27:37 +00:00
apnadkarni 17c37ca31c Merge trunk 2025-05-25 02:59:42 +00:00
dkf 0f9b3af702 Factor out code for describing the args to a method. 2025-05-23 14:51:23 +00:00
dkf 122acc8cfc merge trunk 2025-05-23 10:59:51 +00:00
jan.nijtmans f4148ccf2d Rebase to trunk 2025-05-23 09:24:35 +00:00
dkf 852b5011b5 TIP 720: Bytecode generation improvements/sanity 2025-05-23 09:10:27 +00:00
dkf 9aadfdb56c Clean up indentation and overlong lines 2025-05-23 09:03:35 +00:00
apnadkarni 2162d59e4e Move new list implementations to 9.1 2025-05-23 06:31:09 +00:00
apnadkarni da37aa322d Merged core-9-0-branch 2025-05-23 06:08:46 +00:00
apnadkarni b335e24a13 Create new branch named "apn-tip636-appl-91" 2025-05-23 06:07:03 +00:00
apnadkarni 9a0c9856d3 Merge core-9-0-branch 2025-05-23 02:21:39 +00:00
apnadkarni 86256cad5d Fix [c776eb586d]. Read codepage from registry (reported by Jan) 2025-05-23 02:18:55 +00:00
dkf c0d43e104e Clean up the stat buffer renderer a bit 2025-05-22 19:36:32 +00:00
dkf bb617aa011 tidy up spaces 2025-05-22 14:35:42 +00:00
jan.nijtmans f3b1fa4a60 Merge 9.0 2025-05-22 12:05:05 +00:00
dkf 71b8db3a9a Improvements to TRACE macros and reduce warnings (on some platforms/configs) 2025-05-22 09:39:11 +00:00
jan.nijtmans aef01f5394 Minor optimization: Make sure that TclIsSpaceProcM() doesn't call TclIsSpaceProc() for 'negative' byte values 2025-05-22 09:25:06 +00:00
dkf cb54d306f9 MSVC doesn't like #ifdef in arguments to a macro 2025-05-22 08:11:34 +00:00
apnadkarni 70debab1ce Implement expr in/ni for repeated and reversed list types 2025-05-22 03:19:42 +00:00
dkf 71edf928c8 Use the right internal macro 2025-05-21 10:52:30 +00:00
jan.nijtmans 251a65dfe2 Rebase to latest trunk 2025-05-21 10:09:15 +00:00
dkf b2a81a3d7e merge fix 2025-05-21 08:16:58 +00:00
dkf c1ee663c10 Add back missing file. I don't know why it keeps getting nuked... 2025-05-21 08:03:20 +00:00
apnadkarni 32b0659781 Merge core-9-0-branch 2025-05-21 02:15:43 +00:00
apnadkarni 261e788b4b Update docs 2025-05-21 00:53:05 +00:00
dkf d7d393915e merge trunk (indirectly) 2025-05-20 08:43:43 +00:00
dkf d64b72d8fd fix (rare) merge error 2025-05-20 08:41:34 +00:00
jan.nijtmans 5e124df2db Rebase to trunk 2025-05-20 08:39:33 +00:00
dkf 54cca63d30 merge trunk 2025-05-20 08:39:25 +00:00
dkf a360d1ff46 Fix TEBC internal operand signedness/width; use better variable names for operands 2025-05-20 08:26:21 +00:00
dkf f0f7d04113 merge no-variable-width-instruction-issue 2025-05-20 07:58:15 +00:00
dkf af3de31400 merge trunk 2025-05-20 07:56:37 +00:00
dkf 8195694d54 A few more corrections to Tcl_BounceRefCount usage; definitely no leaks in test suite 2025-05-20 07:55:29 +00:00
apnadkarni e13b7bf325 Fix [3335120320]. Create include dir for installing extensions in non-default locations 2025-05-20 05:30:15 +00:00
apnadkarni a1e0baea6b Fix [3335120320]. Create include dir for installing extensions in non-default locations 2025-05-20 05:26:02 +00:00
dkf 16999286b6 Disable deprecation notices with MSVC; they can get them if they turn on support for C23 2025-05-19 12:01:16 +00:00
dkf 673fb318a9 Promote IsEmptyToken to TclIsEmptyToken, and use in other relevant places 2025-05-19 11:58:18 +00:00
apnadkarni 7a29841637 Some small clarification to abstract list method docs 2025-05-19 11:52:10 +00:00
jan.nijtmans 372a2a96af Update version in .project file 2025-05-19 10:28:56 +00:00
jan.nijtmans bbb91873be Update version in .project file 2025-05-19 10:27:26 +00:00
dkf 912328358c Don't generate the next clause of [for] if it's known to be empty 2025-05-19 09:04:41 +00:00
dkf 293ec0d7c9 Use the sense of space-ness from the parser, not the unicode support 2025-05-19 07:44:59 +00:00
dkf f0c7d69b86 fix errors 2025-05-18 20:26:14 +00:00
apnadkarni a2080b3378 Bug [3335120320]. Fix for case where extension is installed into a directory other than where Tcl is installed 2025-05-18 15:53:31 +00:00
apnadkarni 1b611e1bee merge core-9-0-branch 2025-05-18 06:31:01 +00:00
dkf a3059ecfb2 merge tebc-opnd-types 2025-05-17 15:10:13 +00:00
dkf ca60852f72 Can't just blithely use unsigned; need more Tcl_Size. But that works. 2025-05-16 14:18:29 +00:00
dkf 95655e1884 A bit of tweaking to reduce warnings. 2025-05-16 11:17:51 +00:00
jan.nijtmans 40a88a72aa Merge 8.6 2025-05-16 11:02:26 +00:00
dkf 2607730ae3 Fix TEBC internal operand signedness/width 2025-05-16 09:51:46 +00:00
apnadkarni 3c66bcb735 Oops, CLANG_ASSERT->assert 2025-05-15 15:56:48 +00:00
apnadkarni 1dc49da1cb Minor cleanup 2025-05-15 15:39:40 +00:00
jan.nijtmans bd0d093bad New function Tcl_AttemptGetString(). WIP 2025-05-15 15:14:11 +00:00
dkf 770dd633db Actually, standards-compliant compilers should use the standard form for deprecation 2025-05-15 15:10:38 +00:00
dkf 944bea7be8 Minor optimisation in light of TIP 717 2025-05-15 15:01:15 +00:00
dkf 9ea5c1a2b0 merge no-variable-width-instruction-issue 2025-05-15 14:55:44 +00:00
dkf 0ac7bff9c6 merge trunk 2025-05-15 14:54:46 +00:00
dkf 9ded4a5c19 Need to test _MSVC_VER to see if we're in 19.0 or later to enable [[deprecated]] 2025-05-15 13:15:09 +00:00
dkf c6d1381fb4 Drop reference counts on duplicated objects on error: DICT_PUT and DICT_REMOVE 2025-05-15 13:03:11 +00:00
jan.nijtmans e45ea65375 Something changed in the Github CI environment. Does this fix filename-16.14 testcase? 2025-05-15 11:52:55 +00:00
apnadkarni e115aca98d Add tests for memory leaks 2025-05-15 11:35:18 +00:00
apnadkarni 300e6fafe8 Use internalRep.twoPtrValue.ptr1 and initialize .ptr2 to NULL instead of using
otherValuePtr. Otherwise valgrind complains as Tcl_Representation accesses
.ptr2 which is uninitialized.
2025-05-15 05:59:26 +00:00
dkf 0e0fc46b35 remove TODO comment 2025-05-14 13:19:00 +00:00
dkf 5f9fe4c7b3 Make the [lappend] command into one that handles expansion natively 2025-05-14 12:19:40 +00:00
apnadkarni e174970572 Complete list operation tests 2025-05-14 12:15:24 +00:00
jan.nijtmans 6a0ca4e14c Merge 9.0 2025-05-14 09:19:04 +00:00
jan.nijtmans 379052de37 Merge 8.6 2025-05-14 09:18:15 +00:00
jan.nijtmans 338cdcc115 TIP 717: New function: Tcl_AttemptCreateHashEntry() 2025-05-14 08:09:51 +00:00
apnadkarni e4abfe81b8 Bit more progress on test suite 2025-05-13 19:07:45 +00:00
jan.nijtmans b15dc02b2a Merge trunk 2025-05-13 15:58:54 +00:00
jan.nijtmans bd0892c974 Merge 9.0 2025-05-13 15:42:58 +00:00
jan.nijtmans 9247bf55f4 Merge 8.6 2025-05-13 15:41:57 +00:00
jan.nijtmans 94d3df3717 Put (back) Tcl_CreateHashEntry() stub entry. For better upwards compatibility with TIP #717. Not used in Tcl 9.0 2025-05-13 15:41:21 +00:00
dkf fd8f8e85b0 Expand comments and tidy up a little in the [lappend] compiler 2025-05-13 10:43:02 +00:00
dkf 7520900f79 merge trunk 2025-05-13 07:27:50 +00:00
apnadkarni 550e49b9df Add tests for more list operations and variable indices (when they have a separate code path from literals) 2025-05-12 15:50:18 +00:00
jan.nijtmans de090950d0 Remove Tcl_GetString() stub entry: it isn't used anywhere any more 2025-05-12 11:33:33 +00:00
jan.nijtmans ff74101e1b Merge 9.0 2025-05-12 08:46:23 +00:00
jan.nijtmans 196f398e9f Forget speedup of TclLog2: Negative numbers should behave as 0. 2025-05-12 08:42:13 +00:00
jan.nijtmans 2ab4e97376 _BitScanReverse64() is tested now, so remove comment. Slight speedup for TclLog2, using OR 2025-05-12 08:36:51 +00:00
dkf edf5dfe3e9 fix INST_LAPPEND_LIST semantics with zero-length lists 2025-05-12 06:46:42 +00:00
apnadkarni 7d6d88eb1c ledit and lreplace tests for new abstract lists 2025-05-10 15:12:04 +00:00
dkf ca052cf9ed Notes on expanded-lappend: requires a deep fix elsewhere, so for a future date 2025-05-10 09:26:35 +00:00
dgp 0e8128247f [fd1585e2a1] Adopt efficient internal indexing calculation utility TclMSB(). 2025-05-09 18:13:17 +00:00
dgp 2210bdaf09 [fd1585e2a1] Adopt efficient internal indexing calculation utility TclMSB(). 2025-05-09 18:10:25 +00:00
dgp f2bca09409 Shift stubs entry 2025-05-09 17:55:13 +00:00
dgp 71820613ac merge trunk 2025-05-09 17:52:45 +00:00
jan.nijtmans 07b458931d Merge 9.0 2025-05-09 14:07:22 +00:00
dkf 460ff921b5 merge trunk 2025-05-09 13:16:39 +00:00
dkf 455497137d Final set of changes 2025-05-09 12:09:57 +00:00
jan.nijtmans c3e0794dac Merge 9.0 2025-05-08 15:20:18 +00:00
jan.nijtmans 9c7449fb49 Fix [9dcdddeefe]: compiler warnings. No need to put this in changelog, since it's introduced after 9.0.1. 2025-05-08 15:19:32 +00:00
jan.nijtmans 9a6ca5c470 Merge-mark 2025-05-07 21:22:50 +00:00
jan.nijtmans df7ef174ae Merge 8.6 2025-05-07 21:15:53 +00:00
dkf c07a381b03 merge trunk 2025-05-06 13:42:02 +00:00
dkf 349112862e Fix comment indentation 2025-05-06 13:41:29 +00:00
jan.nijtmans 57d6a76259 Change implementation, using 2 new stub entries 2025-05-06 09:06:53 +00:00
sbron adb1650aa3 Fix links to tickets. 2025-05-06 08:46:45 +00:00
apnadkarni bc01294a88 Merge mark for update 9.0 changes.md 2025-05-06 07:58:13 +00:00
apnadkarni 218a91458a Update changes.md for fixed lseq tickets 2025-05-06 07:54:14 +00:00
jan.nijtmans 8565b15660 Merge 9.0 2025-05-06 07:45:01 +00:00
jan.nijtmans a034b5b04e Fix [8ffd8cabd1]: "encoding system": wrong result without manifest 2025-05-06 07:42:52 +00:00
dkf 9b753ab59f Preparing to be able to disable the opcodes at some later date; we do not want to alter the opcode numbers when we do 2025-05-05 20:14:45 +00:00
dgp d8892d524c Test of [testmsb] checking upper range boundary. 2025-05-05 19:40:29 +00:00
oehhar a0ecb0cc3c [78f44214] Document Tcl_InitStringRep: copy description from TIP 445: better than nothing... 2025-05-05 16:27:48 +00:00
jan.nijtmans 9e8816331f Merge-mark 2025-05-05 15:38:09 +00:00
dkf aff1f2501e merge trunk 2025-05-05 15:34:34 +00:00
dkf 1f531e65e3 Merge tclCompUtils.h into tclCompile.h 2025-05-05 15:34:04 +00:00
oehhar a8485dc6d6 [42d14c495a] Parsing long floating point strings 2025-05-05 14:49:59 +00:00
oehhar 165eb1f3e7 Add to changes.md bug section: scan "long mantissa" %g [42d14c] 2025-05-05 14:47:52 +00:00
dkf c489ce3000 Clean up a bit 2025-05-05 14:43:47 +00:00
oehhar ea6c1b6230 [42d14c495a] Parsing long floating point strings 2025-05-05 14:40:43 +00:00
dgp 5a7a1ab379 Don't let tests pass out-of-range argument to TclMSB(). 2025-05-05 11:44:27 +00:00
jan.nijtmans 5bdca475f1 Merge 9.0 2025-05-05 09:53:44 +00:00
jan.nijtmans ab8975174d Proposed fix for [8ffd8cabd1]: "encoding system": wrong result without manifest
Extracted from TIP 716 implementation
2025-05-05 09:14:42 +00:00
jan.nijtmans c7d153cbbb Missing TclOOM() calls, which produce a panic when Tcl_InitStringRep() fails 2025-05-05 06:53:48 +00:00
dkf 3fcdad6278 Minor tinkering 2025-05-04 16:43:44 +00:00
apnadkarni dc785821c0 Use rangeList Tcl_ObjType for lassign of large lists 2025-05-04 06:51:29 +00:00
apnadkarni 4ddbdc2f1b Implement lrangeType Tcl_Obj 2025-05-03 12:05:05 +00:00
dgp 60aa83fdd4 merge 9.0 2025-05-02 18:31:31 +00:00
dgp 4078b3aa79 merge 8.7 2025-05-02 18:30:34 +00:00
dgp bb33ee662c merge 9.0 2025-05-02 17:58:26 +00:00
dgp dd843d4484 merge fix 2025-05-02 17:58:06 +00:00
dgp a65023af76 typo 2025-05-02 17:00:11 +00:00
dgp 6e4e90b77a typo 2025-05-02 16:57:37 +00:00
dkf ef3d4161e5 Update comment: INST_RETURN_CODE_BRANCH isn't needed in asm any more 2025-05-02 16:06:36 +00:00
dkf c6a7fdc9d4 merge trunk 2025-05-02 16:03:34 +00:00
dkf e33638fe9d Combine the new jumptable into this branch 2025-05-02 15:54:41 +00:00
oehhar 23dca0cd0d [78f44214] Document Tcl_InitStringRep: copy description from TIP 445: better than nothing... 2025-05-02 12:31:29 +00:00
dkf c815194539 Add INST_IS_EMPTY, a surfacing of Tcl_IsEmpty() to bytecode 2025-05-02 08:21:35 +00:00
jan.nijtmans 3929f9e90e Deprecate (internal) TclVarHashCreateVar() function. It isn't (and shouldn't) be used by any extension. 2025-05-02 08:00:32 +00:00
jan.nijtmans e507bdc0e4 Rebase to trunk 2025-05-01 09:19:48 +00:00
apnadkarni eb94916257 Add framework for testing nested lists in different list type combinations 2025-05-01 05:50:08 +00:00
jan.nijtmans 19d1fdff7c Merge 9.0 (indenting) 2025-04-29 13:49:26 +00:00
jan.nijtmans ac3567a097 Indenting and comments, backported from 9.1 2025-04-29 13:48:09 +00:00
dkf 93069ee44f Convert [try ... on ... finally ...] to use a jump table 2025-04-29 09:20:14 +00:00
jan.nijtmans e9fe9e755c Unbreak (gcc) build 2025-04-29 08:51:25 +00:00
dkf 2146c122aa Use a jump table for [try] without 'trap' or 'finally' 2025-04-28 21:22:02 +00:00
apnadkarni 67681ec324 Fix cmdAH tests. See comments below.
Tcl_GetEncodingForUser will not be available until 9.1 for stubs compatibility.
In any case, as a rule, wide char API's should be used in code and tests to avoid the exact kind
of problems we are currently trying to solve with code pages.
2025-04-28 11:30:02 +00:00
apnadkarni febd18f728 Pick up lindex fixes from 9.0 2025-04-28 10:16:32 +00:00
apnadkarni 745e9ef82f Start on test suite for all internal list representations 2025-04-28 10:15:07 +00:00
apnadkarni 4fa72e4d11 Minor tweak. Pass interp as NULL as error thrown away. 2025-04-28 10:03:39 +00:00
apnadkarni a905678adc Minor tweak. Pass interp as NULL as error thrown away. 2025-04-28 09:51:38 +00:00
apnadkarni 88670a2902 Fix [7d3101bf28] and [452b103a74] - lseq indexing crashes. 2025-04-28 09:20:38 +00:00
dkf fa450103b8 Preparing to use a numeric jump table in [try]... but that's tricky to get right so it'll be in a later commit. 2025-04-28 09:03:29 +00:00
apnadkarni 96b3e6bc09 Fix [7d3101bf28] and [452b103a74] - lseq indexing crashes. 2025-04-28 09:01:15 +00:00
jan.nijtmans 8e247cc6a3 Attempt to fix cmdAH test failures. Doesn't work. 2025-04-28 07:37:06 +00:00
apnadkarni 6625300b0d Fix compiled indexlist for lseq 2025-04-28 03:05:52 +00:00
apnadkarni 7e6ae2d3b4 Partial fix and test cases for bug [452b103a74] - lseq nested indices 2025-04-27 14:59:58 +00:00
apnadkarni 1bd82c3ea9 Fix [7d3101bf28] - crash on out of bounds lindex into lseq 2025-04-27 10:48:52 +00:00
apnadkarni 81f7db2d51 Fix lindex crash on non-numeric index into lseq 2025-04-27 10:42:36 +00:00
apnadkarni 1fd30794f5 Crash tests for bugs [45b2] and [7d31] 2025-04-27 10:29:26 +00:00
dkf 03d79b534e Convert [subst] to use a numeric jump table instead of magic offset computations 2025-04-26 15:52:49 +00:00
dkf baee7785fd Whether a value is new to a jump table matters. 2025-04-26 15:08:29 +00:00
dkf 693f52fa84 merge no-variable-width-instruction-issue 2025-04-26 13:36:28 +00:00
dkf 369748c404 Fix cut-n-paste-ism 2025-04-25 15:08:09 +00:00
dkf 3bb36458a1 Add INST_DICT_REMOVE to go with INST_DICT_PUT 2025-04-25 14:37:55 +00:00
dkf fb90452743 More towards the new jump table opcode 2025-04-25 13:52:40 +00:00
jan.nijtmans d3734ecb52 Unneeded "#undef" 2025-04-24 10:09:34 +00:00
jan.nijtmans 03eff5665c Unneeded (char *) typecast 2025-04-24 10:06:25 +00:00
dgp 7393667c57 High performance implementation using GNU compiler builtin. 2025-04-23 18:27:05 +00:00
dgp a6bfdceed2 Speculative high performance implementation using Microsoft compiler intrinsics.
UNTESTED!!!
2025-04-23 17:39:50 +00:00
dkf 6bdfb292f2 Starting to develop a new jump table type for numeric keys 2025-04-23 08:50:08 +00:00
dgp cd11dabef8 Apply Tcl 9 guarantees and conventions. 2025-04-22 17:26:41 +00:00
dgp 18b33c63ad Port the Brodnik adaptation implementaton of TclMSB() from dgp-refactor branch 2025-04-22 17:12:23 +00:00
dgp ee58b4b226 Update testing to Tcl 9 guarantees and conventions. 2025-04-22 17:00:18 +00:00
dgp a54a0757a8 Bring over testing command and tests for TclMSB() from dgp-refactor branch. 2025-04-22 16:50:34 +00:00
dgp 5ea2ee0bfb Restore TclLog2() status to be available only for --enable-symbols=compile 2025-04-22 16:30:58 +00:00
dkf ce3e961fed Make [switch -exact -nocase] compiled 2025-04-22 15:16:56 +00:00
dkf 443637dcd2 Better comments 2025-04-22 14:59:18 +00:00
dkf cf0978ad98 Generate correct arguments to INST_TAILCALL so we don't need to patch them in TEBC 2025-04-21 16:52:17 +00:00
dkf 8058b22442 Factor out some clock-related constants into their own enum 2025-04-21 15:37:21 +00:00
dkf 0a074deaa3 remove junk whitespace 2025-04-21 08:30:11 +00:00
apnadkarni 74bb80deb6 Use abstract lists only above a element count threshold 2025-04-21 04:08:54 +00:00
dkf 0f506c60ed merge trunk 2025-04-20 19:58:16 +00:00
dkf a6be688d45 merge trunk 2025-04-20 19:57:04 +00:00
jan.nijtmans d5e9e1ba68 Merge trunk 2025-04-20 17:07:27 +00:00
jan.nijtmans 4c439372a6 Merge 9.0 2025-04-20 17:03:36 +00:00
jan.nijtmans 07df807261 VarHashCreateVar() isn't used in tclExecute.c 2025-04-20 16:58:24 +00:00
jan.nijtmans eba3a79748 Rebase to trunk 2025-04-20 16:19:32 +00:00
dkf eddf277649 Fix the weirdest bug in the assembler with getting line numbers wrong... sometimes. I'm not even sure that the right thing was being done before... 2025-04-20 15:14:21 +00:00
jan.nijtmans 7e01424293 3th round of (harmless) -Wconversion fixes. Contains better fix for previous commit (thanks, dkf!) 2025-04-20 15:03:12 +00:00
dkf 9a2719509c Fix type.
In at least one compiler, having the line number as int just blew up the build. It's an internal type too; no compat concerns with having it be Tcl_Size.
2025-04-20 12:01:05 +00:00
apnadkarni 4366d35d49 Add abstract list type for lrepeat 2025-04-20 07:49:51 +00:00
jan.nijtmans 47e2f9e1fb Merge trunk. Another round of (harmless) -Wconversion fixes 2025-04-19 16:43:36 +00:00
jan.nijtmans 5ed9b2f277 Many more (harmless) -Wconversion fixes, mainly for the regexp engine 2025-04-19 13:53:24 +00:00
jan.nijtmans 5530db2715 Finish -Wconversion warnings in regexp engine 2025-04-19 12:25:06 +00:00
apnadkarni 6b33a12391 Add an abstract list type for reversing lists 2025-04-19 11:41:18 +00:00
jan.nijtmans f2e4744fc4 Merge 9.0 2025-04-18 14:04:28 +00:00
jan.nijtmans f70603d910 Many more (harmless) -Wconversion fixes, mainly for the regexp engine 2025-04-18 09:22:14 +00:00
jan.nijtmans 2c6bdbf7af Merge 9.0 2025-04-17 21:04:13 +00:00
jan.nijtmans 47e1f51328 Fix warning: variables 'ui' and 'maxSizeDecade' used in loop condition not modified in loop body [-Wfor-loop-analysis]
Remove unnecessary right-shift
2025-04-17 20:53:37 +00:00
jan.nijtmans faee828d70 off-by-8 (thanks, Don!) 2025-04-17 20:09:26 +00:00
dgp 2367b2f504 Re-implement TclLog2() in terms of TclMSB with range limiting wrapped
around the core function.

NOTE: TclLog2() was implemented incorrectly.  As written it was never
going to return values 23 through 30.  It would falsely pin them up to 31.
This bug is still present on the trunk, so will need fixing if this
branch is not approved to merge.
2025-04-17 17:44:54 +00:00
dgp 9d702a3135 The callers of TclLog2() needed its range to be limited to [0..31].
RequiredPrecision needs support for the full long long range.  Create a 
new utility routine TclMSB() to provide the functionality without truncated
range.  Use it.  Put it internal stubs anticipating testing.
2025-04-17 17:30:26 +00:00
dgp 3fcc1a8bb2 Remove code that purports to handle the circumstance when
sizeof(Tcl_WideUInt) > sizeof(long long)

It is believed this is never true in Tcl 9.
2025-04-17 16:41:41 +00:00
dgp 56c39ebf06 Fix up the handling of zero input to RequiredPrecision 2025-04-17 16:30:12 +00:00
culler f64464d18f Update macher version in onefiledist.yml so it will work with a thin macOS executable. 2025-04-17 15:01:57 +00:00
culler 7bf96e0035 Update macher version in onefiledist.yml so it will work with a thin macOS executable. 2025-04-17 14:58:00 +00:00
jan.nijtmans 7add1b667d Another round of -Wconversion warning fixes, see [03cff7a777] 2025-04-17 14:47:13 +00:00
dkf 93c9217da1 remove unread field 2025-04-17 09:09:14 +00:00
dkf 03a7150261 Add INST_TCLOO_ID/tclooId to TAL 2025-04-17 09:07:25 +00:00
dgp 74dd7b71b7 The routine RequiredPrecision() is just a variation on the same function
provided by TclLog2().  Re-implement as a simple wrapper.
2025-04-16 19:26:34 +00:00
dgp 2cf3949e32 Expose TclLog2() to all builds, not limited to --enable-symbols=compile 2025-04-16 18:54:05 +00:00
dgp 54b083e10a Work in progress deploying further optimization and usage of TclLog2(). 2025-04-16 18:04:19 +00:00
dgp 3bf35df982 Correct false claims in the header comment of RequiredPrecision() 2025-04-16 17:34:25 +00:00
dgp ace71ee517 Correct false claims in the header comment of RequiredPrecision() 2025-04-16 17:32:50 +00:00
dkf 82d26bceb4 Clean up some code sections affected by change to always using 4-byte jumps 2025-04-16 12:37:25 +00:00
jan.nijtmans 0841fa9252 Rebase to trunk 2025-04-16 11:25:40 +00:00
jan.nijtmans 0802e6030b (cherry-pick): Clarify exec manpage << entry that the value is encoded and lineendings converted 2025-04-16 09:33:56 +00:00
jan.nijtmans 51d6aedd18 Merge 9.0. Fix some -Wconversion warnings, see [03cff7a777] 2025-04-16 09:00:15 +00:00
jan.nijtmans 33fd941d6d Fix TestplatformChmod() test function: It should always translate from UTF-8 to native, since the native encoding is not guaranteed to be UTF-8 2025-04-16 08:02:44 +00:00
jan.nijtmans 75e82a9831 Missing Tcl_DStringFree() 2025-04-15 11:22:33 +00:00
jan.nijtmans af1fba790a Fix TestplatformChmod() test function: It should always translate from UTF-8 to native, since the native encoding is not guaranteed to be UTF-8 2025-04-15 11:14:23 +00:00
jan.nijtmans 23e3000209 Testcase for TIP #716 2025-04-15 10:40:42 +00:00
jan.nijtmans 7a7d102788 Missing TCL_NO_DEPRECATED 2025-04-15 09:10:23 +00:00
jan.nijtmans a8fc23ad30 Fix more -Wconversion warnings 2025-04-15 07:11:51 +00:00
dkf 90f7b103f2 Give [dict merge] its own compiler using INST_DICT_PUT; enables better [try] and [dict create] compiling too 2025-04-14 19:28:58 +00:00
apnadkarni 2c5e45746f Fix Unix build. Add basic tests 2025-04-14 16:15:05 +00:00
jan.nijtmans c0b81d11b0 Merge 9.0 2025-04-14 14:06:37 +00:00
jan.nijtmans f6019494d6 Review [56f880ad7b|this] commit: Introduce TclNewNamespaceObj() to factor out a common idiom 2025-04-14 13:43:11 +00:00
dkf b3f2fec373 Add [info object creationid] to fully compiled operations; simplify some instruction descriptors 2025-04-14 13:29:57 +00:00
jan.nijtmans 4472e53a91 Put back comment, accidently removed 2025-04-14 11:58:21 +00:00
jan.nijtmans 40ca720fc0 Finish documentation too 2025-04-14 11:23:49 +00:00
dkf 31ca9f0983 merge trunk 2025-04-14 10:46:38 +00:00
apnadkarni 45c2d577fb Clarify exec manpage << entry that the value is encoded and lineendings converted 2025-04-14 10:46:34 +00:00
jan.nijtmans 9b0179044f Merge 9.0 2025-04-14 10:04:14 +00:00
dkf aaf74cba98 Minor improvement to [try/finally] instruction sequence 2025-04-14 09:11:09 +00:00
jan.nijtmans 1c506bb857 Update changes.md 2025-04-14 08:49:14 +00:00
jan.nijtmans 903a415ea1 Fix [92aeb847f9]: proc with more than 2**31 variables 2025-04-14 08:43:50 +00:00
jan.nijtmans 87224fa4f1 Error-message cleanup 2025-04-14 08:10:56 +00:00
jan.nijtmans c55d5a67a4 Merge 9.0 2025-04-13 23:04:41 +00:00
jan.nijtmans c2c0e55bca Put back a comment, which should not have been removed 2025-04-13 23:00:58 +00:00
jan.nijtmans 1ca5801ff3 Merge 9.0 2025-04-13 22:53:07 +00:00
jan.nijtmans 63701cbbb5 Remove comment which is not true any more: TclVarHashFindVar() is not used in Itcl at all.
Remove some unnecessary #undef's
2025-04-13 22:39:47 +00:00
jan.nijtmans 2b0fe4a3ef Implement Tcl_AttemptCreateHashEntry() 2025-04-13 22:16:52 +00:00
jan.nijtmans d46e9784ab Fully functional now, with a lot of examples for the improvement. Also, merge trunk 2025-04-13 21:37:52 +00:00
dkf 66da10b424 merge trunk 2025-04-13 20:58:34 +00:00
dkf ab6d0556fe Macros for comparing tokens to literals, making compiler logically easier to read 2025-04-13 20:46:43 +00:00
apnadkarni 6beacbba8a Added -encoding option to exec 2025-04-12 16:57:22 +00:00
apnadkarni ad696be16d Added encoding user command 2025-04-12 15:11:18 +00:00
apnadkarni 8e89253fad Start on TIP 716 implementation 2025-04-12 12:03:19 +00:00
jan.nijtmans 8b2d288738 fix for BogusCreate() 2025-04-12 08:41:42 +00:00
jan.nijtmans 020cd464d7 Attempt to change special value to (int *)-1. Doesn't work yet. 2025-04-12 08:24:28 +00:00
jan.nijtmans cfd25c802a Merge 9.0 2025-04-11 16:41:30 +00:00
jan.nijtmans 2974c5c956 Fix for [fd8341e496]: Tcl_InitStubs compatibility for 9.1 2025-04-11 16:35:50 +00:00
jan.nijtmans 614543396a (cherry-pick): Updated changes for [010d8f38]. Indenting 2025-04-11 16:18:01 +00:00
jan.nijtmans b86fc1b20a Merge 9.0 2025-04-11 16:05:31 +00:00
jan.nijtmans 1c58843ce0 Fix and speedup for TclLog2() - only used with TCL_COMPILE_STATS. Can now handle values > 2**31 2025-04-11 15:46:48 +00:00
jan.nijtmans f3965a147d Fix [236d18f49b]: More efficient Tcl_FindHashEntry() 2025-04-11 10:36:16 +00:00
dkf 93c27b3700 Some definite cleanup of the [switch] issuer, with neater passing of information around 2025-04-10 21:22:41 +00:00
jan.nijtmans 68f3bddbba Slight improvement: Cleanup before creating error-message 2025-04-10 14:43:12 +00:00
jan.nijtmans 0e3bef1402 First attempt at fixing [92aeb847f9]: proc with more than 2**31 variables. At least, prevent the crash. 2025-04-10 14:22:57 +00:00
stevel bf5c26184b Updated changes with [tclEpollNotfy PlatformEventsControl panics if websocket disconnected](https://core.tcl-lang.org/tcl/tktview/010d8f38) 2025-04-10 04:56:43 +00:00
jan.nijtmans 3da55b052d Merge 9.0 2025-04-09 16:29:07 +00:00
dkf be8b424ef4 Cleaning up a bunch of things in code generation. 2025-04-09 14:18:06 +00:00
jan.nijtmans 1ebc8b52e0 Update rules.vc 2025-04-09 13:49:54 +00:00
jan.nijtmans fd7023a353 Merge 9.0 2025-04-07 17:56:04 +00:00
jan.nijtmans be7b10605c Remove OPTS=tk8 option: It was meant to be able to compile extesions witk Tk 8.7, which will never fly .... 2025-04-07 14:48:58 +00:00
jan.nijtmans 0bb8bcc8c3 Merge 9.0 2025-04-07 09:42:45 +00:00
jan.nijtmans bf2ec5f3b4 (cherry-pick): Fix [010d8f3885] tclEpollNotfy PlatformEventsControl panics if websocket disconnected 2025-04-07 09:41:52 +00:00
jan.nijtmans 928eb67b32 Fix [04aad56155]: __attribute__((noreturn)) conflicts with stdnoreturn.h 2025-04-07 09:37:29 +00:00
stevel 94a306dd5a Fix [010d8f3885] tclEpollNotfy PlatformEventsControl panics if websocket disconnected 2025-04-07 04:20:04 +00:00
jan.nijtmans 68c74682db Merge 9.0 2025-04-06 16:26:17 +00:00
jan.nijtmans 8f7ab1f284 Fix [02fe7f5c89]: tcl::unsupported::icu::detect missing 32-bit error-check 2025-04-06 16:12:26 +00:00
jan.nijtmans de1e171000 Merge 9.0 2025-04-06 16:00:59 +00:00
jan.nijtmans 2240efba03 Eliminate some -Wconversion warnings. Fix comments 2025-04-06 15:55:57 +00:00
jan.nijtmans ea12e36ad2 Merge 9.0 2025-04-03 16:21:43 +00:00
jan.nijtmans a907c61697 Prevent warning on Cygwin: warning: 'ECASECLASH' is no longer used by Cygwin 2025-04-03 16:20:56 +00:00
jan.nijtmans 4e78b01087 Merge 9.0 2025-04-02 22:20:16 +00:00
jan.nijtmans 86b29e49ca Fix "load" testcases on Cygwin, due to wrong --out-implib 2025-04-02 22:16:13 +00:00
jan.nijtmans e790fdecba Merge 9.0 2025-04-02 21:51:43 +00:00
jan.nijtmans 9efa1e9368 Fix -Wconversion warnings 2025-04-02 21:45:59 +00:00
jan.nijtmans 916d53022c Another round of -Wconversion fixes 2025-04-02 08:52:24 +00:00
jan.nijtmans 583dd7c2a4 Fix some -Wconversion warnings 2025-04-01 08:14:35 +00:00
jan.nijtmans 79ed51d25a Fix some -Wconversion warnings 2025-04-01 08:13:35 +00:00
dkf 0706496a46 More corrections 2025-03-30 17:11:03 +00:00
dkf afdadec486 Forgot a critical file. Derp! 2025-03-30 16:45:57 +00:00
dkf c6322dc7d5 Reset after failure a bit more carefully. 2025-03-30 16:30:26 +00:00
jan.nijtmans 254025c6d6 Fix some -Wconversion warnings 2025-03-30 08:41:50 +00:00
dkf eab48b4a77 more consistency of error messages 2025-03-29 15:22:50 +00:00
dkf 9e753e6ef6 merge trunk 2025-03-29 15:12:33 +00:00
dkf 0f6cd492bf Fix [while] compilation, remove a couple of useless tests (opcode changes) 2025-03-29 15:04:21 +00:00
dkf 02e0539f3c Must reset exception ranges on syntax error in assembled code 2025-03-29 11:57:25 +00:00
dkf c80c627dd0 Most tests working, but not yet all. 2025-03-29 09:23:17 +00:00
dkf c21651adee Many changes to basic opcode issuing to eliminate most 1-byte args. Not yet fully working... 2025-03-28 15:25:12 +00:00
jan.nijtmans b5ea9b23ad Merge 9.0 2025-03-26 11:01:44 +00:00
jan.nijtmans b915f649c2 Typo: there is no libucrt.lib 2025-03-26 10:39:15 +00:00
jan.nijtmans 3093caddbc Fix all (Windows) C4244 warnings in win/tclWin*.c files 2025-03-25 16:08:15 +00:00
stevel 70087dd659 Added comments explaining the tclEpollNotfy.c fix 2025-03-24 11:34:19 +00:00
stevel 11b22d6cfc Ticket [https://core.tcl-lang.org/tcl/tktview/010d8f3885642212cf2c65036dd4ad444e9f769e]. A fix for a panic if tclEpollNotfy PlatformEventsControl TclOSfstat returns -1 which it does when using a websocket to a browser and the browser page is refreshed. As per discussions with Jan and Donal the only thing we can do is return and hope it doesn't leak too much memory. 2025-03-24 09:25:03 +00:00
jan.nijtmans 26b8539d56 Merge 9.0 2025-03-23 20:17:12 +00:00
jan.nijtmans 7f0c9dd962 tzdata updated to Olson's tzdata2025b 2025-03-23 18:34:58 +00:00
jan.nijtmans eec22adfe0 Merge 9.0 2025-03-18 21:07:49 +00:00
jan.nijtmans 229e7db6f0 "Makefile.in" part was missing from previous commit. Use $@ in stead of ${LIB_FILE} 2025-03-18 21:06:01 +00:00
dkf 6d80c9d7b2 Switch over to using 4-byte args; mark some ops as deprecated (gcc/clang) 2025-03-18 12:17:50 +00:00
jan.nijtmans 8d35c7488a Fix [17960b80db]: Missing libtcl?.?.dll.a in Cygwin 2025-03-18 09:32:07 +00:00
jan.nijtmans ffb69fa8ba Fix [17960b80db]: Missing libtcl?.?.dll.a in Cygwin 2025-03-18 08:40:02 +00:00
jan.nijtmans 72222df509 Proposed fix for [17960b80db]: Missing libtcl?.?.dll.a in Cygwin 2025-03-17 11:49:44 +00:00
jan.nijtmans ac8aa9269d Make sebres' solution work, so "make dist" works without re-generating */configure with older autoconf 2025-03-16 17:34:44 +00:00
jan.nijtmans f29ba4cae8 Backout [338a305591] for 8.7 and 9.0: autoconf-2.69 is so common nowadays, we want an errormessage for autoconf versions < 2.69 2025-03-16 16:54:31 +00:00
jan.nijtmans 06a7c01750 Conclusion: it's a little bit to early to require autoconf-2.72, since even ubuntu-24.04 doesn't have it yet. 2025-03-16 12:25:45 +00:00
sebres d3391fa4fd merge 9.0 (repair GHA linux/windows builds) 2025-03-15 21:07:01 +00:00
sebres 18c99e164e merge 8.7 2025-03-15 21:05:04 +00:00
dgp 1ff0350e45 [e23e40222e] Revise HashString() to expect a Tcl_Size length argument 2025-03-14 18:53:49 +00:00
sebres f6935ef437 merge 9.0 2025-03-14 18:03:06 +00:00
sebres fd233bc509 merge 8.7 2025-03-14 18:02:31 +00:00
sebres a36eeea1e6 merge 9.0 2025-03-14 17:44:20 +00:00
sebres 60f8d06e71 merge 8.7 2025-03-14 17:41:37 +00:00
jan.nijtmans 38b9f7c216 Update windows runner to windows-2025 2025-03-14 10:37:04 +00:00
jan.nijtmans 6f9b9b347c Update github runner to ubuntu-24.04 2025-03-14 10:28:56 +00:00
jan.nijtmans e845a3e53c Prevent (unix|win)/configure being re-generated with anything else then autoconf-2.72 2025-03-13 21:00:12 +00:00
jan.nijtmans cfc3f536cf spacing 2025-03-13 20:54:28 +00:00
sebres ae922795ba merge 9.0 2025-03-13 14:16:39 +00:00
sebres 76760079f6 merge 8.7 2025-03-13 14:16:12 +00:00
sebres be8f8c1c1d merge 9.0 (fix for clock add regression, relative time with TZ over DST-hole, see clock-30.34) 2025-03-12 17:20:00 +00:00
sebres 5577c42401 merge 8.7 (fix for clock add regression, relative time with TZ over DST-hole, see clock-30.34) 2025-03-12 17:18:31 +00:00
sebres 2ecf82e6f6 merge 9.0 (fix for [482db1d796540e68]) 2025-03-11 18:37:34 +00:00
sebres 34841b6dd2 merge 8.7: fixes [482db1d796540e68], some minor optimizations and another corner cases for a compiler "fix" (signed-mod operation with potentially negative dividend) 2025-03-11 18:36:00 +00:00
jan.nijtmans 0789141841 Update to appleboy/ssh-action@v1.2.2 2025-03-11 08:29:20 +00:00
jan.nijtmans e520a7d033 Update to appleboy/ssh-action@v1.2.2 2025-03-11 08:27:08 +00:00
dkf b2b4b1a7d6 This is an experiment with eliminating the issuing of variable-width instructions
Much complexity in the compiler and bytecode engine comes from handling both instructions with width-1 arguments and width-4 arguments. Just issuing the width-4 versions should simplify things quite a bit, at a cost of making the bytecode less dense. This experiment is to look at the consequences of that.
2025-03-09 15:16:24 +00:00
apnadkarni 82e8d56a5d Added comment for Bug 73bb42fb3f 2025-03-09 03:40:55 +00:00
sebres 397348f0b7 merge 9.0: cmdMZ.test: improve stability of timerate test for quadratic complexity (increase factor for check), also don't run this test on memory-debug builds (may be very time-consuming) 2025-03-07 10:05:06 +00:00
sebres a00ca413eb merge 8.7 2025-03-07 10:04:26 +00:00
sebres 6b0a86d114 merge 9.0: amend to [ba68d1e9484a3a92]: rewrite fix of Tcl_GetReturnOptions less invasive (-errorline was always in return options dict previously, shall not be missed now, and reset line to 1 instead of 0, as less unexpected value) 2025-03-06 19:52:11 +00:00
sebres fbc9cb0e59 merge 8.7 2025-03-06 19:51:03 +00:00
sebres f0bcf18fae merge 9.0 (amend to [ba68d1e9484a3a92] fixed wrong line nummer in Tcl_GetReturnOptions) 2025-03-06 19:32:21 +00:00
sebres 72f98c7020 merge 8.7 (amend to [ba68d1e9484a3a92] fixed wrong line nummer in Tcl_GetReturnOptions) 2025-03-06 19:30:56 +00:00
dgp 3d88b47d7c merge 9.0 2025-03-06 15:15:53 +00:00
dgp 9709bf12cd merge 8.7 2025-03-06 15:15:29 +00:00
sebres dfca061c55 merge 9.0 2025-03-06 14:46:27 +00:00
sebres 20ab62487b merge 8.7 2025-03-06 14:44:53 +00:00
sebres 6fd90733fe merge 9.0 2025-03-06 13:15:16 +00:00
sebres 37b2f98291 merge 8.7 (fixes another variant of [73bb42fb3f35cd61] BUFFER_PADDING panic) 2025-03-06 13:02:32 +00:00
sebres 2839095171 fixes another variant of [73bb42fb3f35cd61] (BUFFER_PADDING panic) with more tests; increases coverage for profile strict 2025-03-06 12:43:04 +00:00
dgp 4c60bb7b4f merge 9.0 2025-03-05 16:00:42 +00:00
dgp ea39f6c212 merge 8.7 2025-03-05 15:49:49 +00:00
dgp 13ce09d30d merge 9.0 2025-03-05 15:28:42 +00:00
dgp f89809c565 merge 8.7 2025-03-05 15:27:54 +00:00
sebres b1c7e13886 new test (PoC): delay between bytes of single multi-byte utf-8 char doesn't cause encoding error with profile strict. 2025-03-05 12:32:26 +00:00
sebres e37698c1ea prepare to cherry-pick to 8.7 (no strict by default) 2025-03-05 12:31:32 +00:00
sebres 765ab9c3a9 proper timeout handling (e is global for after-event) 2025-03-05 11:49:56 +00:00
sebres 661f405b28 improve tests stability - read on non-blocking channel may be delayed (to next "beat" in busy notifier) and return with no data, so read blocked;
one test was not need, doing the same than one below, so removed; added more verbosity in unexpected case (if no error happens for whatever reason)
2025-03-05 11:32:40 +00:00
sebres c6331ec4ed protect against enless loop (if unexpected case), be more verbose if error not happen, etc 2025-03-05 10:40:14 +00:00
apnadkarni 5059bde3ee Test case comment clarification 2025-03-05 06:44:06 +00:00
apnadkarni edf06331d0 Test cases 2025-03-05 06:41:43 +00:00
apnadkarni 1d92ed1fd2 Possible fix for another BUFFER_PADDING panic 2025-03-05 05:43:25 +00:00
dgp cab2cccea8 [e23e40222e] Revise HashString() to expect a Tcl_Size length argument 2025-03-04 20:46:16 +00:00
jan.nijtmans 04d4b6cdfa Merge 9.0 2025-03-04 16:28:06 +00:00
jan.nijtmans 0735721a7b Update changes.md 2025-03-04 16:27:05 +00:00
sebres 35e57ad723 merge 9.0 / clock.tcl: fixes [2c0f49e26c27847a] - ensure cache remain consistent when deriving from parent (don't merge cached localized formats from parent locale) 2025-03-04 15:51:14 +00:00
sebres be146086e9 merge 8.7 / clock.tcl: fixes [2c0f49e26c27847a] - ensure cache remain consistent when deriving from parent (don't merge cached localized formats from parent locale) 2025-03-04 15:50:23 +00:00
jan.nijtmans fa6bfbbcd7 Merge 9.0 2025-03-03 17:57:40 +00:00
jan.nijtmans 5ba44669e0 Update to appleboy/ssh-action@v1.2.1 2025-03-03 17:52:49 +00:00
dkf 0460dbd4bd merge mark 2025-03-03 09:42:58 +00:00
dkf f22c68ab50 Fix bug in Tcl_SetWideUIntObj. 2025-03-03 09:41:48 +00:00
dkf af9dc0bf29 Mostly whitespace fixes, but also a bug in Tcl_SetWideUIntObj 2025-03-03 09:33:42 +00:00
dkf 6dcc8167f2 Bunch of whitespace basic fixes. 2025-03-02 15:48:58 +00:00
jan.nijtmans 841cd34c3b Merge 9.0 2025-02-27 08:32:26 +00:00
jan.nijtmans 8e8ff12a3c Fix [a77029cdea]: MS-VS build system: pckIndex.tcl when building for 9 misses "t" for TCL 8.6 part 2025-02-27 08:26:47 +00:00
dgp 50e955e88a merge 9.0 2025-02-26 20:48:39 +00:00
dgp 74163d999b More constraint name repair 2025-02-26 20:45:46 +00:00
dgp 1db8ba614a merge 8.7 2025-02-26 20:34:48 +00:00
jan.nijtmans 5baad7eda8 Possible fix for [a77029cdea]: MS-VS build system: pckIndex.tcl when building for 9 misses "t" for TCL 8.6 part 2025-02-26 20:32:55 +00:00
dgp 25ea4a18de merge 8.7 2025-02-26 20:29:42 +00:00
dgp 52e2e677d7 dup test names 2025-02-26 18:19:26 +00:00
dgp 275fb469b9 dup test names 2025-02-26 18:03:32 +00:00
jan.nijtmans 28fbeaaa88 int -> Tcl_Size updates to Utf(3), minor markup update 2025-02-25 09:33:14 +00:00
bch 7532f625dd int -> Tcl_Size updates to Utf(3), minor markup update 2025-02-25 05:43:02 +00:00
jan.nijtmans d43a93d92e update README.md 2025-02-24 22:02:03 +00:00
jan.nijtmans 8e6975b78a Merge-mark 2025-02-24 21:37:57 +00:00
jan.nijtmans 4e9f9ef1a9 Fix [211ac77119]: return manual page has a no longer valid example.
avoid "can't read "::tcltestlib": no such variable" in tests *io-60.1 if load catches a fail for some reason
2025-02-24 21:33:10 +00:00
jan.nijtmans f94d27eca3 Fix [211ac77119]: return manual page has a no longer valid example.
avoid "can't read "::tcltestlib": no such variable" in tests *io-60.1 if load catches a fail for some reason
2025-02-24 21:30:05 +00:00
jan.nijtmans ae48cd402d Eliminate TCL_MAJOR_VERSION usage. dde -> 1.5a0 2025-02-23 23:06:00 +00:00
jan.nijtmans 70c6034e0b * In-code comments reflect what is actually happening - eg:
Tcl_GetRange() does *not* only convert the Obj values to a valid
  Unicode string, it will preserve a byte-array if a byte-array is
  what is passed in.

* s/bytearray/byte-array/, consistent with (eg) Tcl_NewByteArrayObj(3)

* update Tcl_GetRange(3) doc to reflect the byte-array -preserving
  aspect.
2025-02-21 22:55:45 +00:00
bch 00c1e6ee3a * In-code comments reflect what is actually happening - eg:
Tcl_GetRange() does *not* only convert the Obj values to a valid
  Unicode string, it will preserve a byte-array if a byte-array is
  what is passed in.

* s/bytearray/byte-array/, consistent with (eg) Tcl_NewByteArrayObj(3)

* update Tcl_GetRange(3) doc to reflect the byte-array -preserving
  aspect.
2025-02-21 00:46:13 +00:00
jan.nijtmans 4df16d173b Apparently, create-dmg/create-dmg doesn't work yet on Apple silicon 2025-02-20 10:56:40 +00:00
jan.nijtmans b801838329 TIP #711: New function: Tcl_IsEmpty() 2025-02-20 09:24:57 +00:00
jan.nijtmans 5e3e3efa52 Rebase to 9.1 2025-02-19 08:37:41 +00:00
jan.nijtmans b43caa2a52 Make a start with 9.1 development, as preparation for TIP #711 2025-02-19 08:36:46 +00:00
jan.nijtmans 7e97ffc51b Split off "9.0" branch, as preparation for TIP #711 2025-02-19 08:29:41 +00:00
apnadkarni dab1ef112e Fix [f5d0e75a49]. Correct tcl::process documentation for non-subprocesses 2025-02-19 05:43:03 +00:00
jan.nijtmans 1d6ca919e2 Be consistant in .VS/.VE tags in documentation: Just mention TIP number, nothing else. 2025-02-18 13:39:06 +00:00
735 changed files with 60015 additions and 65889 deletions
-1
View File
@@ -64,7 +64,6 @@ unix/pkgs8/*
unix/pkgs/*
win/Debug*
win/Release*
win/tcl.pc
win/*.manifest
win/pkgs8/*
win/pkgs/*
-15
View File
@@ -1,15 +0,0 @@
{
"problemMatcher": [
{
"owner": "tcltest",
"pattern": [
{
"regexp": "^==== ([-\\w]+) (.+) (FAILED)$",
"severity": 3,
"message": 2,
"code": 1
}
]
}
]
}
-250
View File
@@ -1,250 +0,0 @@
# This workflow is meant for development use and run only on demand.
# It is customizable to select
# - Platforms
# - Toolchains
# - Branches (no need for core-* prefixes)
# - Tests
# To run the workflow, select "Custom" on the left side in the GH Actions
# page. Then click the Run workflow button on the right. This will display
# a dropdown that allows customization as above.
#
# To run the workflow, you need to have permissions to the repository.
# The simplest way is to clone the Tcl mirror on Github. However, that means
# if you work in fossil, you have a potential 24-hour wait before the mirror
# updates, which apart from nostalgia about the punched card batch processing
# era, is not so convenient. My preference instead is to mirror the fossil
# repository to Github via a local checkout on my system, do the work there
# pushing to github and running this workflow to verify across platforms
# and then committing back to the master fossil repository.
#
# Improvements to the workflow welcome.
name: Custom
on:
workflow_dispatch:
inputs:
platform:
description: 'Target platform(s)")'
required: true
default: 'all'
type: choice
options:
- all
- windows
- linux
- macos
windows_toolchains:
description: 'Windows toolchain'
required: true
type: choice
options:
- '["nmake", "msys"]'
- '["nmake"]'
- '["msys"]'
default: '["nmake"]'
windows_architectures:
description: 'Architecture (Windows Nmake only)'
required: true
type: choice
options:
- '["x64"]'
- '["x86"]'
- '["x64", "x86"]'
default: '["x64"]'
linux_compiler:
description: 'Linux compiler'
required: true
default: 'gcc'
type: choice
options:
- gcc
- clang
run_tests:
description: 'Run tests'
required: false
default: true
type: boolean
test_flags:
description: 'TESTFLAGS'
required: false
default: ''
jobs:
windows:
if: ${{ github.event.inputs.platform == 'windows' || github.event.inputs.platform == 'all' }}
runs-on: windows-2025-vs2026
strategy:
matrix:
arch: ${{ fromJSON(github.event.inputs.windows_architectures) }}
toolchain: ${{ fromJSON(github.event.inputs.windows_toolchains) }}
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{ github.ref }}
# Nmake builds
- name: Setup MSVC (for nmake)
if: ${{ matrix.toolchain == 'nmake' }}
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Build with nmake (Visual C++)
if: ${{ matrix.toolchain == 'nmake' }}
shell: cmd
env:
ERROR_ON_FAILURES: 1
working-directory: win
run: |
nmake /s /f makefile.vc
- name: Tests with nmake (Visual C++)
if: ${{ matrix.toolchain == 'nmake' && inputs.run_tests != 'false' }}
shell: cmd
env:
ERROR_ON_FAILURES: 1
TESTFLAGS: ${{ github.event.inputs.test_flags }}
working-directory: win
run: |
echo TESTFLAGS=%TESTFLAGS%
nmake /s /f makefile.vc test
# Msys builds
- name: Set up msys2 (x64)
if: ${{ matrix.toolchain == 'msys' && matrix.arch == 'x64'}}
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
pacboy: "git: make: gcc:p"
path-type: minimal
release: true
update: false
cache: true
- name: Set up msys2 (x86)
if: ${{ matrix.toolchain == 'msys' && matrix.arch == 'x86'}}
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
pacboy: "git: make: gcc:p"
path-type: minimal
release: true
update: false
cache: true
- name: Verify toolchain
if: ${{ matrix.toolchain == 'msys' }}
shell: bash -l {0}
run: |
gcc -v
make -v
- name: Configure with MSYS
if: ${{ matrix.toolchain == 'msys' }}
env:
ERROR_ON_FAILURES: 1
working-directory: win
shell: msys2 {0}
run: |
mkdir build
cd build
../configure
- name: Compile with MSYS
if: ${{ matrix.toolchain == 'msys' }}
env:
ERROR_ON_FAILURES: 1
shell: msys2 {0}
working-directory: win\build
run: |
file ../../libtommath/win32/tommath.lib
make -s
- name: Tests with MSYS
if: ${{ matrix.toolchain == 'msys' && inputs.run_tests != 'false' }}
env:
ERROR_ON_FAILURES: 1
TESTFLAGS: ${{ github.event.inputs.test_flags }}
working-directory: win\build
shell: msys2 {0}
run: |
echo TESTFLAGS=$TESTFLAGS
make -s test
linux:
if: ${{ github.event.inputs.platform == 'linux' || github.event.inputs.platform == 'all' }}
runs-on: ubuntu-26.04
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Configure with ${{ github.event.inputs.linux_compiler }}
env:
ERROR_ON_FAILURES: 1
CC: ${{ github.event.inputs.linux_compiler }}
working-directory: unix
run: |
mkdir build
cd build
echo CC=$CC
../configure || (cat config.log && exit 1)
- name: Compile
working-directory: unix/build
run: |
make -s
- name: Run tests
if: ${{ inputs.run_tests != 'false' }}
env:
ERROR_ON_FAILURES: 1
TESTFLAGS: ${{ github.event.inputs.test_flags }}
working-directory: unix/build
run: |
echo TESTFLAGS=$TESTFLAGS
make -s test
macos:
if: ${{ github.event.inputs.platform == 'macos' || github.event.inputs.platform == 'all' }}
runs-on: macos-26
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Configure
env:
ERROR_ON_FAILURES: 1
working-directory: unix
run: |
mkdir build
cd build
../configure --enable-framework || (cat config.log && exit 1)
make -s
- name: Compile
working-directory: unix/build
run: |
make -s
- name: Run tests
if: ${{ inputs.run_tests != 'false' }}
env:
ERROR_ON_FAILURES: 1
TESTFLAGS: ${{ github.event.inputs.test_flags }}
working-directory: unix/build
run: |
echo TESTFLAGS=$TESTFLAGS
make -s test
+5 -9
View File
@@ -3,15 +3,14 @@ on:
push:
branches:
- "main"
- "core-9-1-branch"
- "core-9-0-branch"
tags:
- "core-*"
workflow_dispatch:
permissions:
contents: read
jobs:
plan:
runs-on: ubuntu-26.04
runs-on: ubuntu-latest
outputs:
gcc: ${{ steps.matrix.outputs.gcc }}
steps:
@@ -22,7 +21,7 @@ jobs:
echo gcc=$(jq -nc '{config: (if env.IsMatched == "true" then env.FULL else env.PARTIAL end) | fromjson }' )
) | tee -a $GITHUB_OUTPUT
env:
IsMatched: ${{ github.ref_name == 'main' || github.ref_name == 'core-9-1-branch' }}
IsMatched: ${{ github.ref_name == 'main' || github.ref_name == 'core-9-0-branch' }}
# DO NOT CHANGE THESE MATRIX SPECS; IT AFFECTS OUR COST CONTROLS
FULL: >
[
@@ -44,7 +43,7 @@ jobs:
]
gcc:
needs: plan
runs-on: ubuntu-26.04
runs-on: ubuntu-24.04
strategy:
matrix: ${{ fromJson(needs.plan.outputs.gcc) }}
defaults:
@@ -53,7 +52,7 @@ jobs:
working-directory: unix
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v5
timeout-minutes: 5
- name: Install 32-bit dependencies if needed
# Duplicated from above
@@ -86,12 +85,9 @@ jobs:
make runtest SCRIPT=../.github/workflows/info.tcl || echo 'get info failed'
- name: Run Tests
run: |
echo "::add-matcher::.github/tcltest.json"
make test
echo "::remove-matcher::.github/tcltest.json"
env:
ERROR_ON_FAILURES: 1
CI: 1
timeout-minutes: 30
- name: Test-Drive Installation
run: |
+10 -14
View File
@@ -3,15 +3,14 @@ on:
push:
branches:
- "main"
- "core-9-1-branch"
- "core-9-0-branch"
tags:
- "core-*"
workflow_dispatch:
permissions:
contents: read
jobs:
plan:
runs-on: ubuntu-26.04
runs-on: ubuntu-latest
outputs:
clang: ${{ steps.matrix.outputs.clang }}
steps:
@@ -22,7 +21,7 @@ jobs:
echo clang=$(jq -nc '{config: (if env.IsMatched == "true" then env.FULL else env.PARTIAL end) | fromjson }' )
) | tee -a $GITHUB_OUTPUT
env:
IsMatched: ${{ github.ref_name == 'main' || github.ref_name == 'core-9-1-branch' }}
IsMatched: ${{ github.ref_name == 'main' || github.ref_name == 'core-9-0-branch' }}
# DO NOT CHANGE THIS MATRIX SPEC; IT AFFECTS OUR COST CONTROLS
FULL: >
[
@@ -39,14 +38,14 @@ jobs:
"--enable-symbols=all"
]
xcode:
runs-on: macos-26
runs-on: macos-15
defaults:
run:
shell: bash
working-directory: macosx
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v5
timeout-minutes: 5
- name: Prepare
run: |
@@ -58,15 +57,13 @@ jobs:
CFLAGS: -arch x86_64 -arch arm64
timeout-minutes: 15
- name: Run Tests
run: |
echo "::add-matcher::.github/tcltest.json"
make -j4 test styles=develop
run: make -j4 test styles=develop
env:
ERROR_ON_FAILURES: 1
MAC_CI: 1
timeout-minutes: 30
timeout-minutes: 15
clang:
runs-on: macos-26
runs-on: macos-15
needs: plan
strategy:
matrix: ${{ fromJson(needs.plan.outputs.clang) }}
@@ -76,7 +73,7 @@ jobs:
working-directory: unix
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v5
timeout-minutes: 5
- name: Prepare
run: |
@@ -102,9 +99,8 @@ jobs:
make runtest SCRIPT=../.github/workflows/info.tcl || echo 'get info failed'
- name: Run Tests
run: |
echo "::add-matcher::.github/tcltest.json"
make test
env:
ERROR_ON_FAILURES: 1
MAC_CI: 1
timeout-minutes: 30
timeout-minutes: 15
+17 -18
View File
@@ -3,23 +3,22 @@ on:
push:
branches:
- "main"
- "core-9-1-branch"
- "core-9-0-branch"
tags:
- "core-*"
workflow_dispatch:
permissions:
contents: read
jobs:
linux:
name: Linux
runs-on: ubuntu-26.04
runs-on: ubuntu-24.04
defaults:
run:
shell: bash
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v5
- name: Prepare
run: |
touch generic/tclStubInit.c generic/tclOOStubInit.c
@@ -46,7 +45,7 @@ jobs:
ulimit -a || echo 'get limit failed'
echo 'puts exe:\t[info nameofexecutable]\nver:\t[info patchlevel]\t[if {![catch tcl::build-info ret]} {set ret}]\nlib:\t[info library]\nplat:\t[lsort -dictionary -stride 2 [array get tcl_platform]]' | make runtest || echo 'get info failed'
- name: Upload
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@v4
with:
name: Tclsh ${{ env.TCL_PATCHLEVEL }} Linux single-file build (snapshot)
path: 1dist/*.tar
@@ -55,25 +54,25 @@ jobs:
url: ${{ steps.upload.outputs.artifact-url }}
macos:
name: macOS
runs-on: macos-26
runs-on: macos-13
defaults:
run:
shell: bash
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v5
- name: Checkout create-dmg
uses: actions/checkout@v7
uses: actions/checkout@v5
with:
repository: create-dmg/create-dmg
ref: v1.2.2
ref: v1.0.8
path: create-dmg
- name: Prepare
run: |
mkdir 1dist
touch generic/tclStubInit.c generic/tclOOStubInit.c || true
wget https://github.com/culler/macher/releases/download/v1.8/macher
wget https://github.com/culler/macher/releases/download/v1.7/macher
sudo cp macher /usr/local/bin
sudo chmod a+x /usr/local/bin/macher
echo "VER_PATH=$(cd tools; pwd)/addVerToFile.tcl" >> $GITHUB_ENV
@@ -116,7 +115,7 @@ jobs:
ulimit -a || echo 'get limit failed'
echo 'puts exe:\t[info nameofexecutable]\nver:\t[info patchlevel]\t[if {![catch tcl::build-info ret]} {set ret}]\nlib:\t[info library]\nplat:\t[lsort -dictionary -stride 2 [array get tcl_platform]]' | make runtest || echo 'get info failed'
- name: Upload
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@v4
with:
name: Tclsh ${{ env.TCL_PATCHLEVEL }} macOS single-file build (snapshot)
path: 1dist/*.dmg
@@ -125,7 +124,7 @@ jobs:
url: ${{ steps.upload.outputs.artifact-url }}
win:
name: Windows
runs-on: windows-2025-vs2026
runs-on: windows-2025
defaults:
run:
shell: msys2 {0}
@@ -140,7 +139,7 @@ jobs:
msystem: UCRT64
install: git mingw-w64-ucrt-x86_64-toolchain make zip
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v5
- name: Prepare
run: |
touch generic/tclStubInit.c generic/tclOOStubInit.c
@@ -168,7 +167,7 @@ jobs:
ulimit -a || echo 'get limit failed'
echo 'puts exe:\t[info nameofexecutable]\nver:\t[info patchlevel]\t[if {![catch tcl::build-info ret]} {set ret}]\nlib:\t[info library]\nplat:\t[lsort -dictionary -stride 2 [array get tcl_platform]]' | make runtest || echo 'get info failed'
- name: Upload
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@v4
with:
name: Tclsh ${{ env.TCL_PATCHLEVEL }} Windows single-file build (snapshot)
path: '1dist/*_snapshot.exe'
@@ -181,7 +180,7 @@ jobs:
- macos
- win
name: Combine Artifacts (prototype)
runs-on: ubuntu-26.04
runs-on: ubuntu-latest
defaults:
run:
shell: bash
@@ -195,7 +194,7 @@ jobs:
run: |
mkdir data
- name: Get Linux build
uses: actions/download-artifact@v8
uses: actions/download-artifact@v5
with:
path: data
# Can't download by artifact ID; stupid missing feature!
@@ -206,7 +205,7 @@ jobs:
working-directory: data
- name: Transfer built files
# https://github.com/marketplace/actions/rsync-deployments-action
uses: burnett01/rsync-deployments@9.0.1
uses: burnett01/rsync-deployments@7.1.0
id: rsync
if: false # Disabled... for now
with:
@@ -220,7 +219,7 @@ jobs:
# MUST be a literal passwordless key
- name: Publish files
# https://github.com/marketplace/actions/ssh-remote-commands
uses: appleboy/ssh-action@v1.2.5
uses: appleboy/ssh-action@v1.2.2
id: ssh
if: steps.rsync.outcome == 'success'
with:
+11 -21
View File
@@ -3,15 +3,14 @@ on:
push:
branches:
- "main"
- "core-9-1-branch"
- "core-9-0-branch"
tags:
- "core-*"
workflow_dispatch:
permissions:
contents: read
jobs:
plan:
runs-on: ubuntu-26.04
runs-on: ubuntu-latest
outputs:
msvc: ${{ steps.matrix.outputs.msvc }}
gcc: ${{ steps.matrix.outputs.gcc }}
@@ -20,11 +19,11 @@ jobs:
id: matrix
run: |
(
echo msvc=$(jq -nc '{arch: ["x64"], config: (if env.IsMatched == "true" then env.MSVC_FULL else env.MSVC_PARTIAL end) | fromjson }' )
echo msvc=$(jq -nc '{config: (if env.IsMatched == "true" then env.MSVC_FULL else env.MSVC_PARTIAL end) | fromjson }' )
echo gcc=$(jq -nc '{config: (if env.IsMatched == "true" then env.GCC_FULL else env.GCC_PARTIAL end) | fromjson }' )
) | tee -a $GITHUB_OUTPUT
env:
IsMatched: ${{ github.ref_name == 'main' || github.ref_name == 'core-9-1-branch' }}
IsMatched: ${{ github.ref_name == 'main' || github.ref_name == 'core-9-0-branch' }}
# DO NOT CHANGE THESE MATRIX SPECS; IT AFFECTS OUR COST CONTROLS
MSVC_FULL: >
[
@@ -57,7 +56,7 @@ jobs:
"--enable-symbols=all"
]
msvc:
runs-on: windows-2025-vs2026
runs-on: windows-2025
needs: plan
defaults:
run:
@@ -68,14 +67,11 @@ jobs:
# Using powershell means we need to explicitly stop on failure
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v5
timeout-minutes: 5
- name: Init MSVC
shell: cmd
run: |
for /f "usebackq tokens=*" %%i in (`vswhere -latest -property installationPath`) do set "VS_PATH=%%i"
call "%VS_PATH%\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }}
set | findstr /i "^VC ^VCTools ^Windows ^Universal ^INCLUDE ^LIB ^PATH ^DevEnv" >> %GITHUB_ENV%
uses: ilammy/msvc-dev-cmd@v1
timeout-minutes: 5
- name: Build ${{ matrix.config }}
run: |
&nmake -f makefile.vc ${{ matrix.config }} all
@@ -92,7 +88,6 @@ jobs:
timeout-minutes: 5
- name: Run Tests ${{ matrix.config }}
run: |
Write-Output "::add-matcher::.github/tcltest.json"
&nmake -f makefile.vc ${{ matrix.config }} test
if ($lastexitcode -ne 0) {
throw "nmake exit code: $lastexitcode"
@@ -101,7 +96,7 @@ jobs:
env:
ERROR_ON_FAILURES: 1
gcc:
runs-on: windows-2025-vs2026
runs-on: windows-2025
needs: plan
defaults:
run:
@@ -117,7 +112,7 @@ jobs:
install: git mingw-w64-x86_64-toolchain make
timeout-minutes: 10
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@v5
timeout-minutes: 5
- name: Prepare
run: |
@@ -141,15 +136,10 @@ jobs:
ulimit -a || echo 'get limit failed'
make runtest SCRIPT=../.github/workflows/info.tcl || echo 'get info failed'
- name: Run Tests
run: |
echo "::add-matcher::.github/tcltest.json"
make test
run: make test
timeout-minutes: 30
env:
ERROR_ON_FAILURES: 1
- name: Install
run: make install
timeout-minutes: 5
# If you add builds with Wine, be sure to define the environment variable
# CI_USING_WINE when running them so that broken tests know not to run.
-1
View File
@@ -65,6 +65,5 @@ win/pkgs8/*
win/pkgs/*
win/coffbase.txt
win/tcl.hpj
win/tcl.pc
win/nmakehlp.out
win/nmhlp-out.txt
+16 -6
View File
@@ -1,6 +1,6 @@
# README: Tcl
This is the **Tcl 9.1b1** source distribution.
This is the **Tcl 9.1a1** source distribution.
You can get any source release of Tcl from [our distribution
site](https://sourceforge.net/projects/tcl/files/Tcl/).
@@ -64,7 +64,7 @@ There have been many Tcl books on the market. Many are mentioned in
The complete set of reference manual entries for Tcl 9.1 is [online,
here](https://www.tcl-lang.org/man/tcl9.1/).
### <a id="doc.unix"></a> Unix man pages
### <a id="doc.unix">2a.</a> Unix Documentation
The `doc` subdirectory in this release contains a complete set of
reference manual entries for Tcl. Files with extension "`.1`" are for
programs (for example, `tclsh.1`); files with extension "`.3`" are for C
@@ -82,17 +82,27 @@ normal "man" mechanisms, such as
man Tcl
### <a id="doc.win">2b.</a> Windows Documentation
The "doc" subdirectory in this release contains a complete set of Windows
help files for Tcl. Once you install this Tcl release, a shortcut to the
Windows help Tcl documentation will appear in the "Start" menu:
Start | Programs | Tcl | Tcl Help
## <a id="build">3.</a> Compiling and installing Tcl
There are brief notes in the `unix/README`, `win/README`, and `macosx/README`
about compiling on these different platforms. There is additional information
about building Tcl from sources
[online](https://www.tcl-lang.org/doc/howto/compile.html).
## <a id="news">4.</a> News feeds
## <a id="devtools">4.</a> Development tools
ActiveState produces a high-quality set of commercial quality development
tools that is available to accelerate your Tcl application development.
Tcl Dev Kit builds on the earlier TclPro toolset and provides a debugger,
static code checker, single-file wrapping utility, bytecode compiler, and
more. More information can be found at
You can keep up with the latest happenings in the Tcl world via
[fosstodon](https://fosstodon.org/@tcl_tk) or
[X](https://twitter.com/TclLang) feeds.
https://www.activestate.com/products/tcl/
## <a id="complangtcl">5.</a> Tcl newsgroup
There is a USENET newsgroup, "`comp.lang.tcl`", intended for the exchange of
+9 -45
View File
@@ -4,7 +4,7 @@ changes to the Tcl source code at
> [Tcl Source Code](https://core.tcl-lang.org/tcl/timeline)
Release Tcl 9.1b1 arises from the check-in with tag `core-9-1-b1`.
Release Tcl 9.1a1 arises from the check-in with tag `core-9-1-a1`.
Highlighted differences between Tcl 9.1 and Tcl 9.0 are summarized below,
with focus on changes important to programmers using the Tcl library and
@@ -12,58 +12,22 @@ writing Tcl scripts.
# New commands and options
- [New options `-backslashes`, `-commands` and `-variables` for `subst` command](https://core.tcl-lang.org/tips/doc/trunk/tip/712.md)
- [New command `unicode` for Unicode normalization](https://core.tcl-lang.org/tips/doc/trunk/tip/726.md)
- [New `timer` command, switch to monotonic clock and microsecond resolution](https://core.tcl-lang.org/tips/doc/trunk/tip/723.md)
- [Remove `expr` behavior from `lseq`](https://core.tcl-lang.org/tips/doc/trunk/tip/746.md) *Incompatibility*
- [File paths are now treated as case-insensitive on MacOS](https://core.tcl-lang.org/tcl/tktview/e6ca0b1b) *Incompatibility*
- New command `tcl::registry` as a synonym for the `registry` command without needing
the registry package to be loaded. The registry module is now part of the core
Tcl DLL in all build configurations.
- [New `lfilter` command for selecting items from a list](https://core.tcl-lang.org/tips/doc/trunk/tip/735.md)
- [Many new functions from C99](https://core.tcl-lang.org/tips/doc/trunk/tip/745.md), specifically: `acosh()`, `asinh()`, `atanh()`, `cbrt()`, `copysign()`, `dim()`, `erf()`, `erfc()`, `exp2()`, `expm1()`, `fma()`, `gamma()`, `ldexp()`, `lgamma()`, `log1p()`, `log2()`, `logb()`, `nextafter()`, `remainder()`, `signbit()`, and `trunc()`, and (for functions that return multiple values in their C99 API) the commands: `divmod`, `frexp`, `modf`, and `remquo`. (See [this page](https://en.cppreference.com/w/c/numeric/math.html) for more information about these functions; the Tcl functions are _intentionally_ only thin wrappers around the functions in the C99 standard.)
- [New `switch` option `-integer` to compare values as integers](https://core.tcl-lang.org/tips/doc/trunk/tip/730.md)
- [Reading and writing of child interpreter variables](https://core.tcl-lang.org/tips/doc/trunk/tip/728.md)
- [Updated Tcl Bytecode opcodes](https://core.tcl-lang.org/tips/doc/trunk/tip/720.md)
- New `tcltest::configure` option `-iterations` to control number of iterations of each test.
- [New options -backslashes, -commands and -variables for subst command](https://core.tcl-lang.org/tips/doc/trunk/tip/712.md)
- [New command unicode for Unicode normalization](https://core.tcl-lang.org/tips/doc/trunk/tip/726.md)
# New public C API
- [`Tcl_IsEmpty()` &mdash; checks if the string representation of a value would be the empty string](https://core.tcl-lang.org/tips/doc/trunk/tip/711.md)
- [`Tcl_GetEncodingNameForUser()` &mdash; returns name of encoding from user settings](https://core.tcl-lang.org/tips/doc/trunk/tip/716.md)
- [`Tcl_AttemptCreateHashEntry()` &mdash; version of `Tcl_CreateHashEntry()` that returns NULL instead of panic'ing on memory allocation errors](https://core.tcl-lang.org/tips/doc/trunk/tip/717.md)
- [`Tcl_ListObjRange()`, `Tcl_ListObjRepeat()`, `Tcl_ListObjReverse()` &mdash; C API for new list operations](https://core.tcl-lang.org/tips/doc/trunk/tip/649.md)
- [`Tcl_UtfToNormalized()`, `Tcl_UtfToNormalizedDString()` &mdash; C API for Unicode normalization](https://core.tcl-lang.org/tips/doc/trunk/tip/726.md)
- [`Tcl_UtfToExternalEx()` and `Tcl_ExternalToUtfEx()` &mdash; C encoding API supporting output buffers larger than INT_MAX](https://core.tcl-lang.org/tips/doc/trunk/tip/737.md)
- [New API for monotonic clock and microseconds resolution](https://core.tcl-lang.org/tips/doc/trunk/tip/723.md)
- [Windows `auto_execok` enhancements and `exec` search reform](https://core.tcl-lang.org/tips/doc/trunk/tip/753.md)
- [New timer API using long long in stead of Tcl_Time](https://core.tcl-lang.org/tips/doc/trunk/tip/752.md)
# Changes in interpreter initialization
- [Custom applications must call Tcl\_FindExecutable or TclZipfs_AppHook to initialize Tcl](https://core.tcl-lang.org/tips/doc/trunk/tip/732.md) *Potential incompatibility*
- [Search path for locating Tcl core script and encodings is changed](https://core.tcl-lang.org/tips/doc/trunk/tip/732.md) *Potential incompatibility*
- [`Tcl_RegisterPostInitProc` callback for post-initialization of interpreters](https://core.tcl-lang.org/tips/doc/trunk/tip/755.md)
- [Tcl\_IsEmpty checks if the string representation of a value would be the empty string](https://core.tcl-lang.org/tips/doc/trunk/tip/711.md)
- [Tcl\_GetEncodingNameForUser returns name of encoding from user settings](https://core.tcl-lang.org/tips/doc/trunk/tip/716.md)
- [Tcl\_AttemptCreateHashEntry - version of Tcl\_CreateHashEntry that returns NULL instead of panic'ing on memory allocation errors](https://core.tcl-lang.org/tips/doc/trunk/tip/717.md)
- [Tcl\_ListObjRange, Tcl\_ListObjRepeat, Tcl\_TclListObjReverse - C API for new list operations](https://core.tcl-lang.org/tips/doc/trunk/tip/649.md)
- [Tcl\_UtfToNormalized, Tcl\_UtfToNormalizedDString - C API for Unicode normalization](https://core.tcl-lang.org/tips/doc/trunk/tip/726.md)
# Performance
- [Memory efficient internal representations](https://core.tcl-lang.org/tcl/wiki?name=New+abstract+list+representations)
for list operations on large lists.
- [Continued 64-bit capacity: Command line arguments larger than 2Gb](https://core.tcl-lang.org/tips/doc/trunk/tip/626.md)
- [Support for long paths on Windows](https://core.tcl-lang.org/tips/doc/trunk/tip/744.md)
- [Faster UTF-8 encoding and I/O](https://core.tcl-lang.org/tcl/wiki?name=Faster+UTF+encoding)
- Faster interpreter creation
# Bug fixes
- [Inconsistent `glob` matching on MacOS](https://core.tcl-lang.org/tcl/tktview/e6ca0b1b)
- [`file normalize` does not uniquely identify a file on MacOS](https://core.tcl-lang.org/tcl/tktview/10890417)
- [Inconsistencies between `cd` and `file normalize` for volume-relative paths on Windows](https://core.tcl-lang.org/tcl/tktview/bca391ab)
- [Tcl cannot run from an arbitrary build directory with --disable-zipfs](https://core.tcl-lang.org/tcl/tktview/006bef5d)
- [Crash on finalization with an active thread running.](https://core.tcl-lang.org/tcl/tktview/e55a589d)
- [Crash on use-after-free in Windows socket thread.](https://core.tcl-lang.org/tcl/tktview/06f19cc4)
- [tclEpollNotfy PlatformEventsControl panics if websocket disconnected](https://core.tcl-lang.org/tcl/tktview/010d8f38)
# Updated bundled packages, libraries, standards, data
- Unicode 18.0.0 (draft)
- platorm 1.2b1
+1 -1
View File
@@ -4,7 +4,7 @@
* This file provides the gettimeofday function on systems
* that only have the System V ftime function.
*
* Copyright © 1995 Sun Microsystems, Inc.
* Copyright (c) 1995 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+1 -1
View File
@@ -3,7 +3,7 @@
*
* Source code for the "mkstemp" library routine.
*
* Copyright © 2009 Donal K. Fellows
* Copyright (c) 2009 Donal K. Fellows
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
+2 -2
View File
@@ -3,8 +3,8 @@
*
* Source code for the "strncasecmp" library routine.
*
* Copyright © 1988-1993 The Regents of the University of California.
* Copyright © 1995-1996 Sun Microsystems, Inc.
* Copyright (c) 1988-1993 The Regents of the University of California.
* Copyright (c) 1995-1996 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
+2 -2
View File
@@ -5,8 +5,8 @@
* that don't have waitpid but do have wait3. This code is based on a
* prototype version written by Mark Diekhans and Karl Lehenbauer.
*
* Copyright © 1993 The Regents of the University of California.
* Copyright © 1994 Sun Microsystems, Inc.
* Copyright (c) 1993 The Regents of the University of California.
* Copyright (c) 1994 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
-134
View File
@@ -1,134 +0,0 @@
# Copied from https://github.com/bazelbuild/bazel-central-registry/tree/main/modules/zlib/1.3.1.bcr.4/patches
# Adapted from https://github.com/protocolbuffers/protobuf/blob/master/third_party/zlib.BUILD
# Copyright 2008 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Code generated by the Protocol Buffer compiler is owned by the owner
# of the input file used when generating it. This code is not
# standalone and requires a support library to be linked with it. This
# support library is itself covered by the above license.
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_license//rules:license.bzl", "license")
package(
default_applicable_licenses = [":license"],
)
license(
name = "license",
license_kinds = ["@rules_license//licenses/spdx:Zlib"],
license_text = "LICENSE",
)
exports_files([
"LICENSE",
])
_ZLIB_HEADERS = [
"crc32.h",
"deflate.h",
"gzguts.h",
"inffast.h",
"inffixed.h",
"inflate.h",
"inftrees.h",
"trees.h",
"zconf.h",
"zlib.h",
"zutil.h",
]
_ZLIB_PREFIXED_HEADERS = ["zlib/include/" + hdr for hdr in _ZLIB_HEADERS]
# In order to limit the damage from the `includes` propagation
# via `:zlib`, copy the public headers to a subdirectory and
# expose those.
genrule(
name = "copy_public_headers",
srcs = _ZLIB_HEADERS,
outs = _ZLIB_PREFIXED_HEADERS,
cmd_bash = "cp $(SRCS) $(@D)/zlib/include/",
cmd_bat = " && ".join(
["@copy /Y \"$(location %s)\" \"$(@D)\\zlib\\include\\\" >NUL" %
s for s in _ZLIB_HEADERS],
),
)
config_setting(
name = "mingw_gcc_compiler",
flag_values = {
"@bazel_tools//tools/cpp:compiler": "mingw-gcc",
},
visibility = [":__subpackages__"],
)
cc_library(
name = "z",
srcs = [
"adler32.c",
"compress.c",
"crc32.c",
"deflate.c",
"gzclose.c",
"gzlib.c",
"gzread.c",
"gzwrite.c",
"infback.c",
"inffast.c",
"inflate.c",
"inftrees.c",
"trees.c",
"uncompr.c",
"zutil.c",
# Include the un-prefixed headers in srcs to work
# around the fact that zlib isn't consistent in its
# choice of <> or "" delimiter when including itself.
] + _ZLIB_HEADERS,
hdrs = _ZLIB_PREFIXED_HEADERS,
copts = select({
":mingw_gcc_compiler": [
"-fpermissive",
],
"@platforms//os:windows": [],
"//conditions:default": [
"-Wno-deprecated-non-prototype",
"-Wno-unused-variable",
"-Wno-implicit-function-declaration",
],
}),
includes = ["zlib/include/"],
visibility = ["//visibility:public"],
)
alias(
name = "zlib",
actual = ":z",
visibility = ["//visibility:public"],
)
+152 -244
View File
@@ -1,126 +1,98 @@
cmake_minimum_required(VERSION 3.12...3.31)
cmake_minimum_required(VERSION 2.4.4...3.15.0)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
project(
zlib
LANGUAGES C
VERSION 1.3.2
HOMEPAGE_URL "https://zlib.net/"
DESCRIPTION "a general-purpose lossless data-compression library")
project(zlib C)
# ============================================================================
# CPack
# ============================================================================
set(CPACK_PACKAGE_VENDOR "zlib-Project")
set(CPACK_PACKAGE_DESCRIPTION_FILE ${zlib_SOURCE_DIR}/README)
set(CPACK_RESOURCE_FILE_LICENSE ${zlib_SOURCE_DIR}/LICENSE)
set(CPACK_RESOURCE_FILE_README ${zlib_SOURCE_DIR}/README)
set(VERSION "1.3.1")
# ============================================================================
# configuration
# ============================================================================
option(ZLIB_BUILD_EXAMPLES "Enable Zlib Examples" ON)
option(ZLIB_BUILD_TESTING "Enable Zlib Examples as tests" ON)
option(ZLIB_BUILD_SHARED "Enable building zlib shared library" ON)
option(ZLIB_BUILD_STATIC "Enable building zlib static library" ON)
option(ZLIB_INSTALL "Enable installation of zlib" ON)
option(ZLIB_PREFIX "prefix for all types and library functions, see zconf.h.in"
OFF)
mark_as_advanced(ZLIB_PREFIX)
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers")
set(INSTALL_MAN_DIR "${CMAKE_INSTALL_PREFIX}/share/man" CACHE PATH "Installation directory for manual pages")
set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/share/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files")
get_property(IS_MULTI GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT DEFINED CMAKE_BUILD_TYPE AND NOT IS_MULTI)
message(STATUS "No CMAKE_BUILD_TYPE set -- using Release")
set(CMAKE_BUILD_TYPE Release)
endif(NOT DEFINED CMAKE_BUILD_TYPE AND NOT IS_MULTI)
include(CheckCSourceCompiles)
include(CheckTypeSize)
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CMakePackageConfigHelpers)
include(CheckTypeSize)
include(CPack)
include(GNUInstallDirs)
include(CheckCSourceCompiles)
enable_testing()
set(CPACK_INCLUDED TRUE)
if(NOT ZLIB_CONF_WRITTEN)
set(Z_PREFIX ${ZLIB_PREFIX})
set(CONF_OUT_FILE ${zlib_BINARY_DIR}/zconf.h.cmakein)
file(READ ${zlib_SOURCE_DIR}/zconf.h ZCONF_CONTENT LIMIT 245)
file(WRITE ${CONF_OUT_FILE} ${ZCONF_CONTENT})
file(APPEND ${CONF_OUT_FILE} "#cmakedefine Z_PREFIX 1\n")
file(APPEND ${CONF_OUT_FILE} "#cmakedefine HAVE_STDARG_H 1\n")
file(APPEND ${CONF_OUT_FILE} "#cmakedefine HAVE_UNISTD_H 1\n")
file(READ ${zlib_SOURCE_DIR}/zconf.h ZCONF_CONTENT OFFSET 244)
set(FIRST_ITEM TRUE)
foreach(item IN LISTS ZCONF_CONTENT)
if(FIRST_ITEM)
string(APPEND OUT_CONTENT ${item})
set(FIRST_ITEM FALSE)
else(FIRST_ITEM)
string(APPEND OUT_CONTENT "\;" ${item})
endif(FIRST_ITEM)
endforeach(item IN LISTS ${ZCONF_CONTENT})
file(APPEND ${CONF_OUT_FILE} ${OUT_CONTENT})
set(ZLIB_CONF_WRITTEN
TRUE
CACHE BOOL "zconf.h.cmakein was created")
mark_as_advanced(ZLIB_CONF_WRITTEN)
endif(NOT ZLIB_CONF_WRITTEN)
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stddef.h HAVE_STDDEF_H)
#
# Check to see if we have large file support
#
set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
# We add these other definitions here because CheckTypeSize.cmake
# in CMake 2.4.x does not automatically do so and we want
# compatibility with CMake 2.4.x.
if(HAVE_SYS_TYPES_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
endif()
if(HAVE_STDINT_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
endif()
if(HAVE_STDDEF_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
endif()
check_type_size(off64_t OFF64_T)
unset(CMAKE_REQUIRED_DEFINITIONS) # clear variable
if(HAVE_OFF64_T)
add_definitions(-D_LARGEFILE64_SOURCE=1)
endif()
set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
#
# Check for fseeko
#
check_function_exists(fseeko HAVE_FSEEKO)
#
# Check for stdarg.h
#
check_include_file(stdarg.h HAVE_STDARG_H)
if(NOT HAVE_FSEEKO)
add_definitions(-DNO_FSEEKO)
endif()
#
# Check for unistd.h
#
check_include_file(unistd.h HAVE_UNISTD_H)
check_include_file(unistd.h Z_HAVE_UNISTD_H)
#
# Check visibility attribute is supported
#
if(MSVC)
set(CMAKE_REQUIRED_FLAGS "-WX")
else(MSVC)
set(CMAKE_REQUIRED_FLAGS "-Werror")
endif(MSVC)
set(CMAKE_DEBUG_POSTFIX "d")
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
endif()
check_c_source_compiles(
"
#include <stdlib.h>
static void f(void) __attribute__ ((visibility(\"hidden\")));
int main(void) {return 0;}
"
HAVE___ATTR__VIS_HIDDEN)
if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
# If we're doing an out of source build and the user has a zconf.h
# in their source tree...
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h)
message(STATUS "Renaming")
message(STATUS " ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h")
message(STATUS "to 'zconf.h.included' because this file is included with zlib")
message(STATUS "but CMake generates it automatically in the build directory.")
file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.included)
endif()
endif()
unset(CMAKE_COMPILE_FLAGS)
set(ZLIB_PC ${zlib_BINARY_DIR}/zlib.pc)
configure_file(${zlib_SOURCE_DIR}/zlib.pc.cmakein ${ZLIB_PC} @ONLY)
configure_file(${zlib_BINARY_DIR}/zconf.h.cmakein ${zlib_BINARY_DIR}/zconf.h)
set(ZLIB_PC ${CMAKE_CURRENT_BINARY_DIR}/zlib.pc)
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein
${ZLIB_PC} @ONLY)
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein
${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY)
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR})
# ============================================================================
#============================================================================
# zlib
# ============================================================================
set(ZLIB_PUBLIC_HDRS ${zlib_BINARY_DIR}/zconf.h zlib.h)
#============================================================================
set(ZLIB_PUBLIC_HDRS
${CMAKE_CURRENT_BINARY_DIR}/zconf.h
zlib.h
)
set(ZLIB_PRIVATE_HDRS
crc32.h
deflate.h
@@ -130,8 +102,8 @@ set(ZLIB_PRIVATE_HDRS
inflate.h
inftrees.h
trees.h
zutil.h)
zutil.h
)
set(ZLIB_SRCS
adler32.c
compress.c
@@ -147,164 +119,100 @@ set(ZLIB_SRCS
inffast.c
trees.c
uncompr.c
zutil.c)
zutil.c
)
if(WIN32)
set(zlib_static_suffix "s")
set(CMAKE_DEBUG_POSTFIX "d")
endif(WIN32)
if(NOT MINGW)
set(ZLIB_DLL_SRCS
win32/zlib1.rc # If present will override custom build rule below.
)
endif()
if(ZLIB_BUILD_SHARED)
add_library(
zlib SHARED ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}
$<$<OR:$<BOOL:${WIN32}>,$<BOOL:${CYGWIN}>>:win32/zlib1.rc>)
add_library(ZLIB::ZLIB ALIAS zlib)
target_include_directories(
zlib
PUBLIC $<BUILD_INTERFACE:${zlib_BINARY_DIR}>
$<BUILD_INTERFACE:${zlib_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_compile_definitions(
zlib
PRIVATE ZLIB_BUILD
$<$<BOOL:NOT:${HAVE_FSEEKO}>:NO_FSEEKO>
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>
$<$<BOOL:${MSVC}>:_CRT_SECURE_NO_DEPRECATE>
$<$<BOOL:${MSVC}>:_CRT_NONSTDC_NO_DEPRECATE>
PUBLIC $<$<BOOL:${HAVE_OFF64_T}>:_LARGEFILE64_SOURCE=1>)
set(INSTALL_VERSION ${zlib_VERSION})
# parse the full version number from zlib.h and include in ZLIB_FULL_VERSION
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents)
string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"
"\\1" ZLIB_FULL_VERSION ${_zlib_h_contents})
if(NOT CYGWIN)
set_target_properties(zlib PROPERTIES SOVERSION ${zlib_VERSION_MAJOR}
VERSION ${INSTALL_VERSION})
endif(NOT CYGWIN)
if(MINGW)
# This gets us DLL resource information when compiling on MinGW.
if(NOT CMAKE_RC_COMPILER)
set(CMAKE_RC_COMPILER windres.exe)
endif()
set_target_properties(
zlib
PROPERTIES DEFINE_SYMBOL ZLIB_DLL
EXPORT_NAME ZLIB
OUTPUT_NAME z)
if(UNIX
AND NOT APPLE
AND NOT (CMAKE_SYSTEM_NAME STREQUAL AIX)
AND NOT (CMAKE_SYSTEM_NAME STREQUAL SunOS))
# On unix-like platforms the library is almost always called libz
set_target_properties(
zlib
PROPERTIES LINK_FLAGS
"-Wl,--version-script,\"${zlib_SOURCE_DIR}/zlib.map\"")
endif(
UNIX
AND NOT APPLE
AND NOT (CMAKE_SYSTEM_NAME STREQUAL AIX)
AND NOT (CMAKE_SYSTEM_NAME STREQUAL SunOS))
endif(ZLIB_BUILD_SHARED)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
COMMAND ${CMAKE_RC_COMPILER}
-D GCC_WINDRES
-I ${CMAKE_CURRENT_SOURCE_DIR}
-I ${CMAKE_CURRENT_BINARY_DIR}
-o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
-i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
endif(MINGW)
if(ZLIB_BUILD_STATIC)
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS}
${ZLIB_PRIVATE_HDRS})
add_library(ZLIB::ZLIBSTATIC ALIAS zlibstatic)
target_include_directories(
zlibstatic
PUBLIC $<BUILD_INTERFACE:${zlib_BINARY_DIR}>
$<BUILD_INTERFACE:${zlib_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_compile_definitions(
zlibstatic
PRIVATE ZLIB_BUILD
$<$<BOOL:NOT:${HAVE_FSEEKO}>:NO_FSEEKO>
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>
$<$<BOOL:${MSVC}>:_CRT_SECURE_NO_DEPRECATE>
$<$<BOOL:${MSVC}>:_CRT_NONSTDC_NO_DEPRECATE>
PUBLIC $<$<BOOL:${HAVE_OFF64_T}>:_LARGEFILE64_SOURCE=1>)
set_target_properties(
zlibstatic PROPERTIES EXPORT_NAME ZLIBSTATIC OUTPUT_NAME
z${zlib_static_suffix})
endif(ZLIB_BUILD_STATIC)
add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
target_include_directories(zlib PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
target_include_directories(zlibstatic PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
set_target_properties(zlib PROPERTIES SOVERSION 1)
if(ZLIB_INSTALL)
if(ZLIB_BUILD_SHARED)
install(
TARGETS zlib
COMPONENT Runtime
EXPORT zlibSharedExport
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
install(
EXPORT zlibSharedExport
FILE ZLIB-shared.cmake
NAMESPACE ZLIB::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/zlib)
if(NOT CYGWIN)
# This property causes shared libraries on Linux to have the full version
# encoded into their final filename. We disable this on Cygwin because
# it causes cygz-${ZLIB_FULL_VERSION}.dll to be created when cygz.dll
# seems to be the default.
#
# This has no effect with MSVC, on that platform the version info for
# the DLL comes from the resource file win32/zlib1.rc
set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION})
endif()
if(MSVC)
install(
FILES $<TARGET_PDB_FILE:zlib>
COMPONENT Runtime
DESTINATION ${CMAKE_INSTALL_BINDIR}
CONFIGURATIONS Debug OR RelWithDebInfo
OPTIONAL)
endif(MSVC)
endif(ZLIB_BUILD_SHARED)
if(UNIX)
# On unix-like platforms the library is almost always called libz
set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
if(NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX))
set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
endif()
elseif(BUILD_SHARED_LIBS AND WIN32)
# Creates zlib1.dll when building shared library version
set_target_properties(zlib PROPERTIES SUFFIX "1.dll")
endif()
if(ZLIB_BUILD_STATIC)
install(
TARGETS zlibstatic
COMPONENT Development
EXPORT zlibStaticExport
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
install(
EXPORT zlibStaticExport
FILE ZLIB-static.cmake
NAMESPACE ZLIB::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/zlib)
endif(ZLIB_BUILD_STATIC)
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
install(TARGETS zlib zlibstatic
RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" )
endif()
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
install(FILES ${ZLIB_PUBLIC_HDRS} DESTINATION "${INSTALL_INC_DIR}")
endif()
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
install(FILES zlib.3 DESTINATION "${INSTALL_MAN_DIR}/man3")
endif()
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
install(FILES ${ZLIB_PC} DESTINATION "${INSTALL_PKGCONFIG_DIR}")
endif()
configure_package_config_file(
${zlib_SOURCE_DIR}/zlibConfig.cmake.in
${zlib_BINARY_DIR}/ZLIBConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/zlib)
#============================================================================
# Example binaries
#============================================================================
if(ZLIB_BUILD_EXAMPLES)
add_executable(example test/example.c)
target_link_libraries(example zlib)
add_test(example example)
write_basic_package_version_file(
"${zlib_BINARY_DIR}/ZLIBConfigVersion.cmake"
VERSION "${zlib_VERSION}"
COMPATIBILITY AnyNewerVersion)
add_executable(minigzip test/minigzip.c)
target_link_libraries(minigzip zlib)
install(FILES ${zlib_BINARY_DIR}/ZLIBConfig.cmake
${zlib_BINARY_DIR}/ZLIBConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/zlib)
install(
FILES ${ZLIB_PUBLIC_HDRS}
COMPONENT Development
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(
FILES zlib.3
COMPONENT Docs
DESTINATION "${CMAKE_INSTALL_MANDIR}/man3")
install(
FILES LICENSE
doc/algorithm.txt
doc/crc-doc.1.0.pdf
doc/rfc1950.txt
doc/rfc1951.txt
doc/rfc1952.txt
doc/txtvsbin.txt
COMPONENT Docs
DESTINATION "${CMAKE_INSTALL_DOCDIR}/zlib")
install(
FILES ${ZLIB_PC}
COMPONENT Development
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
endif(ZLIB_INSTALL)
if(HAVE_OFF64_T)
add_executable(example64 test/example.c)
target_link_libraries(example64 zlib)
set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
add_test(example64 example64)
# ============================================================================
# Tests
# ============================================================================
if(ZLIB_BUILD_TESTING)
enable_testing()
add_subdirectory(test)
endif(ZLIB_BUILD_TESTING)
add_subdirectory(contrib)
add_executable(minigzip64 test/minigzip.c)
target_link_libraries(minigzip64 zlib)
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
endif()
endif()
-51
View File
@@ -1,57 +1,6 @@
ChangeLog file for zlib
Changes in 1.3.2 (17 Feb 2026)
- Continued rewrite of CMake build [Vollstrecker]
- Various portability improvements
- Various github workflow additions and improvements
- Check for negative lengths in crc32_combine functions
- Copy only the initialized window contents in inflateCopy
- Prevent the use of insecure functions without an explicit request
- Add compressBound_z and deflateBound_z functions for large values
- Use atomics to build inflate fixed tables once
- Add definition of ZLIB_INSECURE to build tests with c89 and c94
- Add --undefined option to ./configure for UBSan checker
- Copy only the initialized deflate state in deflateCopy
- Zero inflate state on allocation
- Remove untgz from contrib
- Add _z versions of the compress and uncompress functions
- Vectorize the CRC-32 calculation on the s390x
- Set bit 11 of the zip header flags in minizip if UTF-8
- Update OS/400 support
- Add a test to configure to check for a working compiler
- Check for invalid NULL pointer inputs to zlib operations
- Add --mandir to ./configure to specify manual directory
- Add LICENSE.Info-Zip to contrib/minizip
- Remove vstudio projects in lieu of cmake-generated projects
- Replace strcpy() with memcpy() in contrib/minizip
Changes in 1.3.1.2 (8 Dec 2025)
- Improve portability to RISC OS
- Permit compiling contrib/minizip/unzip.c with decryption
- Enable build of shared library on AIX
- Make deflateBound() more conservative and handle Z_STREAM_END
- Add zipAlreadyThere() to minizip zip.c to help avoid duplicates
- Make z_off_t 64 bits by default
- Add deflateUsed() function to get the used bits in the last byte
- Avoid out-of-bounds pointer arithmetic in inflateCopy()
- Add Haiku to configure for proper LDSHARED settings
- Add Bazel targets
- Complete rewrite of CMake build [Vollstrecker]
- Clarify the use of errnum in gzerror()
- Note that gzseek() requests are deferred until the next operation
- Note the use of gzungetc() to run a deferred seek while reading
- Fix bug in inflatePrime() for 16-bit ints
- Add a "G" option to force gzip, disabling transparency in gzread()
- Improve the discrimination between trailing garbage and bad gzip
- Allow gzflush() to write empty gzip members
- Remove redundant frees of point list on error in examples/zran.c
- Clarify the use of inflateGetHeader()
- Update links to the RFCs
- Return all available uncompressed data on error in gzread.c
- Support non-blocking devices in the gz* routines
- Various other small improvements
Changes in 1.3.1 (22 Jan 2024)
- Reject overflows of zip header fields in minizip
- Fix bug in inflateSync() for data held in bit buffer
+21 -25
View File
@@ -3,8 +3,8 @@
If your question is not there, please check the zlib home page
https://zlib.net/ which may have more recent information.
The latest zlib FAQ is at https://zlib.net/zlib_faq.html
http://zlib.net/ which may have more recent information.
The latest zlib FAQ is at http://zlib.net/zlib_faq.html
1. Is zlib Y2K-compliant?
@@ -19,7 +19,7 @@ The latest zlib FAQ is at https://zlib.net/zlib_faq.html
3. Where can I get a Visual Basic interface to zlib?
See
* https://zlib.net/nelson/
* http://marknelson.us/1997/01/01/zlib-engine/
* win32/DLL_FAQ.txt in the zlib distribution
4. compress() returns Z_BUF_ERROR.
@@ -38,7 +38,7 @@ The latest zlib FAQ is at https://zlib.net/zlib_faq.html
made with more input or output space. A Z_BUF_ERROR may in fact be
unavoidable depending on how the functions are used, since it is not
possible to tell whether or not there is more output pending when
strm.avail_out returns with zero. See https://zlib.net/zlib_how.html for a
strm.avail_out returns with zero. See http://zlib.net/zlib_how.html for a
heavily annotated example.
6. Where's the zlib documentation (man pages, etc.)?
@@ -109,8 +109,8 @@ The latest zlib FAQ is at https://zlib.net/zlib_faq.html
16. Can zlib decode Flate data in an Adobe PDF file?
Yes. See https://www.pdflib.com/ . To modify PDF forms, see
https://sourceforge.net/projects/acroformtool/ .
Yes. See http://www.pdflib.com/ . To modify PDF forms, see
http://sourceforge.net/projects/acroformtool/ .
17. Why am I getting this "register_frame_info not found" error on Solaris?
@@ -156,10 +156,6 @@ The latest zlib FAQ is at https://zlib.net/zlib_faq.html
library memory allocation routines by default. zlib's *Init* functions
allow for the application to provide custom memory allocation routines.
If the non-default BUILDFIXED or DYNAMIC_CRC_TABLE defines are used on a
system without atomics (e.g. pre-C11), then inflate() and crc32() will not
be thread safe.
Of course, you should only operate on any given zlib or gzip stream from a
single thread at a time.
@@ -239,7 +235,7 @@ The latest zlib FAQ is at https://zlib.net/zlib_faq.html
As far as we know, no. In fact, that was originally the whole point behind
zlib. Look here for some more information:
https://web.archive.org/web/20180729212847/http://www.gzip.org/#faq11
http://www.gzip.org/#faq11
32. Can zlib work with greater than 4 GB of data?
@@ -262,20 +258,20 @@ The latest zlib FAQ is at https://zlib.net/zlib_faq.html
33. Does zlib have any security vulnerabilities?
The only one that we are aware of is potentially in gzprintf(). If zlib is
compiled to use sprintf() or vsprintf(), which requires that ZLIB_INSECURE
be defined, then there is no protection against a buffer overflow of an 8K
string space (or other value as set by gzbuffer()), other than the caller
of gzprintf() assuring that the output will not exceed 8K. On the other
hand, if zlib is compiled to use snprintf() or vsnprintf(), which should
normally be the case, then there is no vulnerability. The ./configure
script will display warnings if an insecure variation of sprintf() will be
used by gzprintf(). Also the zlibCompileFlags() function will return
information on what variant of sprintf() is used by gzprintf().
compiled to use sprintf() or vsprintf(), then there is no protection
against a buffer overflow of an 8K string space (or other value as set by
gzbuffer()), other than the caller of gzprintf() assuring that the output
will not exceed 8K. On the other hand, if zlib is compiled to use
snprintf() or vsnprintf(), which should normally be the case, then there is
no vulnerability. The ./configure script will display warnings if an
insecure variation of sprintf() will be used by gzprintf(). Also the
zlibCompileFlags() function will return information on what variant of
sprintf() is used by gzprintf().
If you don't have snprintf() or vsnprintf() and would like one, you can
find a good portable implementation in stb_sprintf.h here:
find a portable implementation here:
https://github.com/nothings/stb
http://www.ijs.si/software/snprintf/
Note that you should be using the most recent version of zlib. Versions
1.1.3 and before were subject to a double-free vulnerability, and versions
@@ -287,7 +283,7 @@ The latest zlib FAQ is at https://zlib.net/zlib_faq.html
Probably what you want is to use zlib in Java. zlib is already included
as part of the Java SDK in the java.util.zip package. If you really want
a version of zlib written in the Java language, look on the zlib home
page for links: https://zlib.net/ .
page for links: http://zlib.net/ .
35. I get this or that compiler or source-code scanner warning when I crank it
up to maximally-pedantic. Can't you guys write proper code?
@@ -318,9 +314,9 @@ The latest zlib FAQ is at https://zlib.net/zlib_faq.html
zlib doesn't support encryption. The original PKZIP encryption is very
weak and can be broken with freely available programs. To get strong
encryption, use GnuPG, https://www.gnupg.org/ , which already includes zlib
encryption, use GnuPG, http://www.gnupg.org/ , which already includes zlib
compression. For PKZIP compatible "encryption", look at
https://infozip.sourceforge.net/
http://www.info-zip.org/
39. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings?
+2 -1
View File
@@ -21,11 +21,12 @@ zlib.pc.cmakein zlib.pc template for cmake
zlib2ansi perl script to convert source files for C++ compilation
amiga/ makefiles for Amiga SAS C
as400/ makefiles for AS/400
doc/ documentation for formats and algorithms
msdos/ makefiles for MSDOS
nintendods/ makefile for Nintendo DS
old/ makefiles for various architectures and zlib documentation
files that have not yet been updated for zlib 1.2.x
os400/ makefiles for OS/400
qnx/ makefiles for QNX
watcom/ makefiles for OpenWatcom
win32/ makefiles for Windows
+1 -1
View File
@@ -1,6 +1,6 @@
Copyright notice:
(C) 1995-2026 Jean-loup Gailly and Mark Adler
(C) 1995-2022 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
-9
View File
@@ -1,9 +0,0 @@
module(
name = "zlib",
version = "0.0.0",
compatibility_level = 1,
)
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_cc", version = "0.0.16")
bazel_dep(name = "rules_license", version = "1.0.0")
+18 -34
View File
@@ -1,5 +1,5 @@
# Makefile for zlib
# Copyright (C) 1995-2026 Jean-loup Gailly, Mark Adler
# Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
# For conditions of distribution and use, see copyright notice in zlib.h
# To compile and test, type:
@@ -13,8 +13,6 @@
# make install prefix=$HOME
CC=cc
GCOV=GCOV
LLVM_GCOV_FLAG=LLMV_GCOV_FLAG
CFLAGS=-O
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
@@ -27,11 +25,10 @@ LDFLAGS=
TEST_LIBS=-L. libz.a
LDSHARED=$(CC)
CPP=$(CC) -E
VGFMAFLAG=
STATICLIB=libz.a
SHAREDLIB=libz.so
SHAREDLIBV=libz.so.1.3.2
SHAREDLIBV=libz.so.1.3.1
SHAREDLIBM=libz.so.1
LIBS=$(STATICLIB) $(SHAREDLIBV)
@@ -115,16 +112,16 @@ test64: all64
fi
@rm -f tmp64_$$
infcover.o: $(SRCDIR)test/infcover.c $(SRCDIR)zlib.h zconf.h $(SRCDIR)inflate.h $(SRCDIR)inftrees.h
$(CC) $(CFLAGS) $(ZINCOUT) -c -coverage -o $@ $(SRCDIR)test/infcover.c
infcover.o: $(SRCDIR)test/infcover.c $(SRCDIR)zlib.h zconf.h
$(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/infcover.c
infcover: infcover.o libz.a
$(CC) $(CFLAGS) -coverage -o $@ infcover.o libz.a
$(CC) $(CFLAGS) -o $@ infcover.o libz.a
cover: infcover
rm -f *.gcda
${QEMU_RUN} ./infcover
${GCOV} ${LLVM_GCOV_FLAG} inf*.c -o ./infcover.gcda
gcov inf*.c
libz.a: $(OBJS)
$(AR) $(ARFLAGS) $@ $(OBJS)
@@ -161,9 +158,6 @@ adler32.o: $(SRCDIR)adler32.c
crc32.o: $(SRCDIR)crc32.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)crc32.c
crc32_vx.o: $(SRCDIR)contrib/crc32vx/crc32_vx.c
$(CC) $(CFLAGS) $(VGFMAFLAG) $(ZINC) -c -o $@ $(SRCDIR)contrib/crc32vx/crc32_vx.c
deflate.o: $(SRCDIR)deflate.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)deflate.c
@@ -182,7 +176,7 @@ inftrees.o: $(SRCDIR)inftrees.c
trees.o: $(SRCDIR)trees.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)trees.c
zutil.o: $(SRCDIR)zutil.c $(SRCDIR)gzguts.h
zutil.o: $(SRCDIR)zutil.c
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)zutil.c
compress.o: $(SRCDIR)compress.c
@@ -214,11 +208,6 @@ crc32.lo: $(SRCDIR)crc32.c
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/crc32.o $(SRCDIR)crc32.c
-@mv objs/crc32.o $@
crc32_vx.lo: $(SRCDIR)contrib/crc32vx/crc32_vx.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) $(VGFMAFLAG) $(ZINC) -DPIC -c -o objs/crc32_vx.o $(SRCDIR)contrib/crc32vx/crc32_vx.c
-@mv objs/crc32_vx.o $@
deflate.lo: $(SRCDIR)deflate.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/deflate.o $(SRCDIR)deflate.c
@@ -249,7 +238,7 @@ trees.lo: $(SRCDIR)trees.c
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/trees.o $(SRCDIR)trees.c
-@mv objs/trees.o $@
zutil.lo: $(SRCDIR)zutil.c $(SRCDIR)gzguts.h
zutil.lo: $(SRCDIR)zutil.c
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/zutil.o $(SRCDIR)zutil.c
-@mv objs/zutil.o $@
@@ -285,7 +274,7 @@ gzwrite.lo: $(SRCDIR)gzwrite.c
-@mv objs/gzwrite.o $@
placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a $(SRCDIR)zlib.map
placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
$(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
rm -f $(SHAREDLIB) $(SHAREDLIBM)
ln -s $@ $(SHAREDLIB)
@@ -360,13 +349,12 @@ docs: zlib.3.pdf
zlib.3.pdf: $(SRCDIR)zlib.3
groff -mandoc -f H -T ps $(SRCDIR)zlib.3 | ps2pdf - $@
# zconf.h.cmakein: $(SRCDIR)zconf.h.in
# -@ TEMPFILE=zconfh_$$; \
# echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\
# sed -f $$TEMPFILE $(SRCDIR)zconf.h.in > $@ &&\
# touch -r $(SRCDIR)zconf.h.in $@ &&\
# rm $$TEMPFILE
#
zconf.h.cmakein: $(SRCDIR)zconf.h.in
-@ TEMPFILE=zconfh_$$; \
echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\
sed -f $$TEMPFILE $(SRCDIR)zconf.h.in > $@ &&\
touch -r $(SRCDIR)zconf.h.in $@ &&\
rm $$TEMPFILE
zconf: $(SRCDIR)zconf.h.in
cp -p $(SRCDIR)zconf.h.in zconf.h
@@ -390,7 +378,7 @@ clean: minizip-clean
rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov
maintainer-clean: distclean
distclean: clean zconf # zconf.h.cmakein
distclean: clean zconf zconf.h.cmakein
rm -f Makefile zlib.pc configure.log
-@rm -f .DS_Store
@if [ -f Makefile.in ]; then \
@@ -401,8 +389,7 @@ distclean: clean zconf # zconf.h.cmakein
tags:
etags $(SRCDIR)*.[ch]
adler32.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
zutil.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
adler32.o zutil.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
gzclose.o gzlib.o gzread.o gzwrite.o: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
compress.o example.o minigzip.o uncompr.o: $(SRCDIR)zlib.h zconf.h
crc32.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)crc32.h
@@ -411,10 +398,8 @@ infback.o inflate.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.
inffast.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h
inftrees.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h
trees.o: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)trees.h
crc32_vx.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)contrib/crc32vx/crc32_vx_hooks.h
adler32.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
zutil.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
adler32.lo zutil.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
gzclose.lo gzlib.lo gzread.lo gzwrite.lo: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
compress.lo example.lo minigzip.lo uncompr.lo: $(SRCDIR)zlib.h zconf.h
crc32.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)crc32.h
@@ -423,4 +408,3 @@ infback.lo inflate.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftree
inffast.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h
inftrees.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h
trees.lo: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)trees.h
crc32_vx.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)contrib/crc32vx/crc32_vx_hooks.h
+15 -13
View File
@@ -1,10 +1,10 @@
ZLIB DATA COMPRESSION LIBRARY
zlib 1.3.2 is a general purpose data compression library. All the code is
thread safe (though see the FAQ for caveats). The data format used by the zlib
library is described by RFCs (Request for Comments) 1950 to 1952 at
https://datatracker.ietf.org/doc/html/rfc1950 (zlib format), rfc1951 (deflate
format) and rfc1952 (gzip format).
zlib 1.3.1 is a general purpose data compression library. All the code is
thread safe. The data format used by the zlib library is described by RFCs
(Request for Comments) 1950 to 1952 in the files
http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
rfc1952 (gzip format).
All functions of the compression library are documented in the file zlib.h
(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example
@@ -21,17 +21,17 @@ make_vms.com.
Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant
<info@winimage.com> for the Windows DLL version. The zlib home page is
https://zlib.net/ . Before reporting a problem, please check this site to
http://zlib.net/ . Before reporting a problem, please check this site to
verify that you have the latest version of zlib; otherwise get the latest
version and check whether the problem still exists or not.
PLEASE read the zlib FAQ https://zlib.net/zlib_faq.html before asking for help.
PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help.
Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
issue of Dr. Dobb's Journal; a copy of the article is available at
https://zlib.net/nelson/ .
https://marknelson.us/posts/1997/01/01/zlib-engine.html .
The changes made in version 1.3.2 are documented in the file ChangeLog.
The changes made in version 1.3.1 are documented in the file ChangeLog.
Unsupported third party contributions are provided in directory contrib/ .
@@ -43,9 +43,9 @@ can be found at https://github.com/pmqs/IO-Compress .
A Python interface to zlib written by A.M. Kuchling <amk@amk.ca> is
available in Python 1.5 and later versions, see
https://docs.python.org/3/library/zlib.html .
http://docs.python.org/library/zlib.html .
zlib is built into tcl: https://wiki.tcl-lang.org/page/zlib .
zlib is built into tcl: http://wiki.tcl.tk/4610 .
An experimental package to read and write files in .zip format, written on top
of zlib by Gilles Vollant <info@winimage.com>, is available in the
@@ -69,7 +69,9 @@ Notes for some targets:
- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with
other compilers. Use "make test" to check your compiler.
- For PalmOs, see https://palmzlib.sourceforge.net/
- gzdopen is not supported on RISCOS or BEOS.
- For PalmOs, see http://palmzlib.sourceforge.net/
Acknowledgments:
@@ -81,7 +83,7 @@ Acknowledgments:
Copyright notice:
(C) 1995-2026 Jean-loup Gailly and Mark Adler
(C) 1995-2024 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
-79
View File
@@ -1,79 +0,0 @@
# For building with cmake at least version 3.12 (minizip 3.12) is needed
In most cases the usual
cmake -S . -B build -D CMAKE_BUILD_TYPE=Release
will create everything you need, however if you want something off default you can adjust several options fit your needs.
Every option is list below (excluding the cmake-standard options), they can be set via cmake-gui or on cmdline with
-D<option>=ON/OFF
## ZLIB-options with defaults ##
ZLIB_BUILD_TESTING=ON -- Enable Zlib Examples as tests
ZLIB_BUILD_SHARED=ON -- Enable building zlib shared library
ZLIB_BUILD_STATIC=ON -- Enable building zlib static library
ZLIB_BUILD_MINIZIP=ON -- Enable building libminizip contrib library
If this option is turned on, additional options are available from minizip (see below)
ZLIB_INSTALL=ON -- Enable installation of zlib
ZLIB_PREFIX=OFF -- prefix for all types and library functions, see zconf.h.in
This option is only on windows available and may/will be turned off and removed somewhen in the future.
If you rely cmake for finding and using zlib, this can be turned off, as `zlib1.dll` will never be used.
## minizip-options with defaults ##
MINIZIP_BUILD_SHARED=ON -- Enable building minizip shared library
MINIZIP_BUILD_STATIC=ON -- Enable building minizip static library
MINIZIP_BUILD_TESTING=ON -- Enable testing of minizip
MINIZIP_ENABLE_BZIP2=ON -- Build minizip withj bzip2 support
A usable installation of bzip2 is needed or config will fail. Turn this option of in this case.
MINIZIP_INSTALL=ON -- Enable installation of minizip
This option is only available on mingw as they tend to name this lib different. Maybe this will also be
removed in the future as. If you rely cmake for finding and using zlib, this can be turned off, as
the other file will never be used.
## Using the libs ##
To pull in what you need it's enough to just write
find_package(ZLIB CONFIG)
or
find_package(minizip CONFIG)
in your CMakeLists.txt, however it is advised to specify what you really want via:
find_package(ZLIB CONFIG COMPONENTS shared static REQUIRED)
or
find_package(minizip CONFIG COMPONENTS shared static REQUIRED)
As it's possible to only build the shared or the static lib, you can make sure that everything you need
is found. If no COMPONENTS are requested, everything needs to be found to satisfy your request. If the
libraries are optional in you project, you can omit the REQUIRED and check yourself if the targets you
want to link against are created.
When you search for minizip, it will search zlib for you, so only one of both is needed.
## Imported targets ##
When found the following targets are created for you:
ZLIB::ZLIB and ZLIB::ZLIBSTATIC -- for zlib
MINIZIP::minizip and MINIZIP::minizipstatic -- for minizip
+10 -34
View File
@@ -1,5 +1,5 @@
/* compress.c -- compress a memory buffer
* Copyright (C) 1995-2026 Jean-loup Gailly, Mark Adler
* Copyright (C) 1995-2005, 2014, 2016 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -18,19 +18,13 @@
compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
The _z versions of the functions take size_t length arguments.
*/
int ZEXPORT compress2_z(Bytef *dest, z_size_t *destLen, const Bytef *source,
z_size_t sourceLen, int level) {
int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source,
uLong sourceLen, int level) {
z_stream stream;
int err;
const uInt max = (uInt)-1;
z_size_t left;
if ((sourceLen > 0 && source == NULL) ||
destLen == NULL || (*destLen > 0 && dest == NULL))
return Z_STREAM_ERROR;
uLong left;
left = *destLen;
*destLen = 0;
@@ -49,36 +43,23 @@ int ZEXPORT compress2_z(Bytef *dest, z_size_t *destLen, const Bytef *source,
do {
if (stream.avail_out == 0) {
stream.avail_out = left > (z_size_t)max ? max : (uInt)left;
stream.avail_out = left > (uLong)max ? max : (uInt)left;
left -= stream.avail_out;
}
if (stream.avail_in == 0) {
stream.avail_in = sourceLen > (z_size_t)max ? max :
(uInt)sourceLen;
stream.avail_in = sourceLen > (uLong)max ? max : (uInt)sourceLen;
sourceLen -= stream.avail_in;
}
err = deflate(&stream, sourceLen ? Z_NO_FLUSH : Z_FINISH);
} while (err == Z_OK);
*destLen = (z_size_t)(stream.next_out - dest);
*destLen = stream.total_out;
deflateEnd(&stream);
return err == Z_STREAM_END ? Z_OK : err;
}
int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source,
uLong sourceLen, int level) {
int ret;
z_size_t got = *destLen;
ret = compress2_z(dest, &got, source, sourceLen, level);
*destLen = (uLong)got;
return ret;
}
/* ===========================================================================
*/
int ZEXPORT compress_z(Bytef *dest, z_size_t *destLen, const Bytef *source,
z_size_t sourceLen) {
return compress2_z(dest, destLen, source, sourceLen,
Z_DEFAULT_COMPRESSION);
}
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source,
uLong sourceLen) {
return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
@@ -88,12 +69,7 @@ int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source,
If the default memLevel or windowBits for deflateInit() is changed, then
this function needs to be updated.
*/
z_size_t ZEXPORT compressBound_z(z_size_t sourceLen) {
z_size_t bound = sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
(sourceLen >> 25) + 13;
return bound < sourceLen ? (z_size_t)-1 : bound;
}
uLong ZEXPORT compressBound(uLong sourceLen) {
z_size_t bound = compressBound_z(sourceLen);
return (uLong)bound != bound ? (uLong)-1 : (uLong)bound;
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
(sourceLen >> 25) + 13;
}
+39 -188
View File
@@ -87,15 +87,10 @@ zprefix=0
zconst=0
build64=0
gcc=0
clang=0
warn=0
debug=0
address=0
memory=0
undefined=0
insecure=0
unknown=0
enable_crcvx=1
old_cc="$CC"
old_cflags="$CFLAGS"
OBJC='$(OBJZ) $(OBJG)'
@@ -121,49 +116,40 @@ case "$1" in
-h* | --help)
echo 'usage:' | tee -a configure.log
echo ' configure [--const] [--zprefix] [--prefix=PREFIX] [--eprefix=EXPREFIX]' | tee -a configure.log
echo ' [--insecure] [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]' | tee -a configure.log
echo ' [--includedir=INCLUDEDIR] [--mandir=MANDIR]' | tee -a configure.log
echo ' [--archs="-arch i386 -arch x86_64"] [--disable-crcvx]' | tee -a configure.log
echo ' [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]' | tee -a configure.log
echo ' [--includedir=INCLUDEDIR] [--archs="-arch i386 -arch x86_64"]' | tee -a configure.log
exit 0 ;;
-p*=* | --prefix=*) prefix=`echo $1 | sed 's/[^=]*=//'`; shift ;;
-e*=* | --eprefix=*) exec_prefix=`echo $1 | sed 's/[^=]*=//'`; shift ;;
-l*=* | --libdir=*) libdir=`echo $1 | sed 's/[^=]*=//'`; shift ;;
--sharedlibdir=*) sharedlibdir=`echo $1 | sed 's/[^=]*=//'`; shift ;;
-i*=* | --includedir=*) includedir=`echo $1 | sed 's/[^=]*=//'`;shift ;;
-m*=* | --mandir=*) mandir=`echo $1 | sed 's/[^=]*=//'`;shift ;;
-u*=* | --uname=*) uname=`echo $1 | sed 's/[^=]*=//'`;shift ;;
-p*=* | --prefix=*) prefix=`echo $1 | sed 's/.*=//'`; shift ;;
-e*=* | --eprefix=*) exec_prefix=`echo $1 | sed 's/.*=//'`; shift ;;
-l*=* | --libdir=*) libdir=`echo $1 | sed 's/.*=//'`; shift ;;
--sharedlibdir=*) sharedlibdir=`echo $1 | sed 's/.*=//'`; shift ;;
-i*=* | --includedir=*) includedir=`echo $1 | sed 's/.*=//'`;shift ;;
-u*=* | --uname=*) uname=`echo $1 | sed 's/.*=//'`;shift ;;
-p* | --prefix) prefix="$2"; shift; shift ;;
-e* | --eprefix) exec_prefix="$2"; shift; shift ;;
-l* | --libdir) libdir="$2"; shift; shift ;;
--sharedlibdir) sharedlibdir="$2"; shift; shift ;;
-i* | --includedir) includedir="$2"; shift; shift ;;
-m* | --mandir) mandir="$2"; shift; shift ;;
-u* | --uname) uname="$2"; shift; shift ;;
-s* | --shared | --enable-shared) shared=1; shift ;;
-t | --static | --disable-shared) shared=0; shift ;;
-t | --static) shared=0; shift ;;
--solo) solo=1; shift ;;
--cover) cover=1; shift ;;
-z* | --zprefix) zprefix=1; shift ;;
-6* | --64) build64=1; shift ;;
-a*=* | --archs=*) ARCHS=`echo $1 | sed 's/[^=]*=//'`; shift ;;
-a* | --archs) ARCHS="$2"; shift; shift ;;
-a*=* | --archs=*) ARCHS=`echo $1 | sed 's/.*=//'`; shift ;;
--sysconfdir=*) echo "ignored option: --sysconfdir" | tee -a configure.log; shift ;;
--localstatedir=*) echo "ignored option: --localstatedir" | tee -a configure.log; shift ;;
-c* | --const) zconst=1; shift ;;
-w* | --warn) warn=$((warn + 1)); shift ;;
-w* | --warn) warn=1; shift ;;
-d* | --debug) debug=1; shift ;;
--sanitize) address=1; shift ;;
--address) address=1; shift ;;
--memory) memory=1; shift ;;
--undefined) undefined=1; shift ;;
--insecure) insecure=1; shift ;;
--disable-crcvx) enable_crcvx=0; shift ;;
*) unknown=1; echo "unknown option ignored: $1" | tee -a configure.log; shift;;
*)
echo "unknown option: $1" | tee -a configure.log
echo "$0 --help for help" | tee -a configure.log
leave 1;;
esac
done
if test $unknown -eq 1; then
echo "$0 --help for help" | tee -a configure.log
fi
# temporary file name
test=ztest$$
@@ -198,89 +184,41 @@ else
fi
case "$cc" in
*gcc*) gcc=1
GCOV="gcov" ;;
*clang*) gcc=1
clang=1 ;;
*gcc*) gcc=1 ;;
*clang*) gcc=1 ;;
esac
case `$cc -v 2>&1` in
*gcc*) gcc=1
GCOV="gcov" ;;
*clang*) gcc=1
clang=1 ;;
*gcc*) gcc=1 ;;
*clang*) gcc=1 ;;
esac
if test $cover -eq 1; then
if test "$clang" -eq 1; then
if test "$cc" = "clang"; then
if command -v llvm-cov >/dev/null 2>&1; then
GCOV="llvm-cov"
LLVM_GCOV_FLAG="gcov"
GCOV="llvm-cov"
LLVM_GCOV_FLAG="gcov"
echo "Using ${GCOV} for coverage"
else
cover=0
GCOV=""
LLVM_GCOV_FLAG=""
echo "Deactivating cover as no suitable gcov can be found"
fi
else
clangV=`echo "$cc" | sed -e 's/^.*-//'`
if command -v llvm-cov-${clangV} >/dev/null 2>&1; then
GCOV="llvm-cov-${clangV}"
LLVM_GCOV_FLAG="gcov"
echo "Using ${GCOV} for coverage"
else
cover=0
GCOV=""
LLVM_GCOV_FLAG=""
echo "Deactivating cover as no suitable gcov can be found"
fi
fi
fi
fi
show $cc -c $test.c
if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
echo ... using gcc >> configure.log
CC="$cc"
CFLAGS="${CFLAGS--O3} -fPIC"
SFLAGS="${CFLAGS--O3}"
CFLAGS="${CFLAGS--O3}"
SFLAGS="${CFLAGS--O3} -fPIC"
if test "$ARCHS"; then
CFLAGS="${CFLAGS} ${ARCHS}"
SFLAGS="${SFLAGS} ${ARCHS}"
LDFLAGS="${LDFLAGS} ${ARCHS}"
fi
if test $build64 -eq 1; then
CFLAGS="${CFLAGS} -m64"
SFLAGS="${SFLAGS} -m64"
fi
if test "$warn" -ge 1; then
CFLAGS="${CFLAGS} -Wall -Wextra"
if test "$warn" -ge 2; then
CFLAGS="${CFLAGS} -Wconversion -Wshadow -Wundef"
if test "$warn" -eq 1; then
if test "$zconst" -eq 1; then
CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -DZLIB_CONST"
else
CFLAGS="${CFLAGS} -Wall -Wextra"
fi
fi
if test "$zconst" -eq 1; then
if test "$warn" -ge 1; then
CFLAGS="${CFLAGS} -Wcast-qual"
fi
CFLAGS="${CFLAGS} -DZLIB_CONST"
fi
if test $address -eq 1; then
CFLAGS="${CFLAGS} -g -fsanitize=address -fno-omit-frame-pointer"
fi
if test $memory -eq 1; then
CFLAGS="${CFLAGS} -g -fsanitize=memory -fno-omit-frame-pointer"
fi
if test $undefined -eq 1; then
CFLAGS="${CFLAGS} -g -fsanitize=undefined -fno-omit-frame-pointer"
fi
if test $insecure -eq 1; then
CFLAGS="${CFLAGS} -DZLIB_INSECURE"
SFLAGS="${SFLAGS} -DZLIB_INSECURE"
fi
if test $debug -eq 1; then
CFLAGS="${CFLAGS} -DZLIB_DEBUG"
SFLAGS="${SFLAGS} -DZLIB_DEBUG"
@@ -289,7 +227,7 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
uname=`(uname -s || echo unknown) 2>/dev/null`
fi
case "$uname" in
Linux* | linux* | *-linux* | GNU | GNU/* | solaris* | Haiku)
Linux* | linux* | *-linux* | GNU | GNU/* | solaris*)
case "$mname" in
*sparc*)
LDFLAGS="${LDFLAGS} -Wl,--no-warn-rwx-segments" ;;
@@ -320,7 +258,6 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
SHAREDLIB='libz.sl' ;;
esac ;;
AIX*)
LDSHARED=${LDSHARED-"$cc -shared"}
LDFLAGS="${LDFLAGS} -Wl,-brtl" ;;
Darwin* | darwin* | *-darwin*)
shared_ext='.dylib'
@@ -426,12 +363,7 @@ else
AIX*) # Courtesy of dbakker@arrayasolutions.com
SFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
CFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
LDSHARED=${LDSHARED-"xlc -G"}
if test $build64 -eq 1; then
CFLAGS="${CFLAGS} -q64"
SFLAGS="${SFLAGS} -q64"
ARFLAGS="-X64 ${ARFLAGS}"
fi ;;
LDSHARED=${LDSHARED-"xlc -G"} ;;
# send working options for other systems to zlib@gzip.org
*) SFLAGS=${CFLAGS-"-O"}
CFLAGS=${CFLAGS-"-O"}
@@ -492,13 +424,6 @@ tryboth()
cat > $test.c << EOF
int foo() { return 0; }
EOF
echo "Checking for compiler..." >> configure.log
if try $CC -c $test.c; then
:
else
echo "Missing or broken C compiler." | tee -a configure.log
leave 1
fi
echo "Checking for obsessive-compulsive compiler options..." >> configure.log
if try $CC -c $CFLAGS $test.c; then
:
@@ -518,7 +443,7 @@ if test $shared -eq 1; then
echo Checking for shared library support... | tee -a configure.log
# we must test in two steps (cc then ld), required at least on SunOS 4.x
if try $CC -c $SFLAGS $test.c &&
try $LDSHARED $SFLAGS $LDFLAGS -o $test$shared_ext $test.o; then
try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then
echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log
elif test -z "$old_cc" -a -z "$old_cflags"; then
echo No shared library support. | tee -a configure.log
@@ -580,7 +505,7 @@ int main(void) {
}
EOF
fi
if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
if try $CC $CFLAGS -o $test $test.c; then
sizet=`./$test`
echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log
CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
@@ -614,7 +539,7 @@ int main(void) {
return 0;
}
EOF
if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
if try $CC $CFLAGS -o $test $test.c; then
echo "Checking for fseeko... Yes." | tee -a configure.log
else
CFLAGS="${CFLAGS} -DNO_FSEEKO"
@@ -631,7 +556,7 @@ cat > $test.c <<EOF
#include <errno.h>
int main() { return strlen(strerror(errno)); }
EOF
if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
if try $CC $CFLAGS -o $test $test.c; then
echo "Checking for strerror... Yes." | tee -a configure.log
else
CFLAGS="${CFLAGS} -DNO_STRERROR"
@@ -650,7 +575,7 @@ cat > $test.c <<EOF
int main() { return 0; }
EOF
if try $CC -c $CFLAGS $test.c; then
sed < zconf.h "/^#ifdef HAVE_STDARG_H.* may be/s/ HAVE_UNISTD_H-0\(.*\) may be/ 1\1 was/" > zconf.temp.h
sed < zconf.h "/^#ifdef HAVE_UNISTD_H.* may be/s/def HAVE_UNISTD_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
mv zconf.temp.h zconf.h
echo "Checking for unistd.h... Yes." | tee -a configure.log
else
@@ -665,7 +590,7 @@ cat > $test.c <<EOF
int main() { return 0; }
EOF
if try $CC -c $CFLAGS $test.c; then
sed < zconf.h "/^#ifdef HAVE_STDARG_H.* may be/s/ HAVE_STDARG_H-0\(.*\) may be/ 1\1 was/" > zconf.temp.h
sed < zconf.h "/^#ifdef HAVE_STDARG_H.* may be/s/def HAVE_STDARG_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
mv zconf.temp.h zconf.h
echo "Checking for stdarg.h... Yes." | tee -a configure.log
else
@@ -693,6 +618,7 @@ fi
# if code coverage testing was requested, use older gcc if defined, e.g. "gcc-4.2" on Mac OS X
if test $cover -eq 1; then
CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
if test -n "$GCC_CLASSIC"; then
CC=$GCC_CLASSIC
fi
@@ -737,7 +663,7 @@ int main()
return (mytest("Hello%d\n", 1));
}
EOF
if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
if try $CC $CFLAGS -o $test $test.c; then
echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log
echo >> configure.log
@@ -777,10 +703,7 @@ EOF
echo " WARNING: vsnprintf() not found, falling back to vsprintf(). zlib" | tee -a configure.log
echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log
echo " vulnerabilities." | tee -a configure.log
if test $insecure -ne 1; then
echo " The --insecure option must be provided to ./configure in order to" | tee -a configure.log
echo " compile using the insecure vsprintf() function." | tee -a configure.log
fi
echo >> configure.log
cat >$test.c <<EOF
#include <stdio.h>
@@ -830,7 +753,7 @@ int main()
}
EOF
if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
if try $CC $CFLAGS -o $test $test.c; then
echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log
echo >> configure.log
@@ -864,10 +787,7 @@ EOF
echo " WARNING: snprintf() not found, falling back to sprintf(). zlib" | tee -a configure.log
echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log
echo " vulnerabilities." | tee -a configure.log
if test $insecure -ne 1; then
echo " The --insecure option must be provided to ./configure in order to" | tee -a configure.log
echo " compile using the insecure sprintf() function." | tee -a configure.log
fi
echo >> configure.log
cat >$test.c <<EOF
#include <stdio.h>
@@ -915,70 +835,6 @@ EOF
fi
fi
# check for ibm s390x build
HAVE_S390X=0
cat > $test.c << EOF
#ifndef __s390x__
#error
#endif
EOF
if try $CC -c $CFLAGS $test.c; then
echo "Checking for s390x build ... Yes." | tee -a configure.log
HAVE_S390X=1
else
echo "Checking for s390x build ... No." | tee -a configure.log
fi
# check for ibm s390x vx vector extensions
HAVE_S390X_VX=0
if test $HAVE_S390X -eq 1 && test $enable_crcvx -eq 1 ; then
# preset the compiler specific flags
if test $clang -eq 1; then
VGFMAFLAG=-fzvector
else
VGFMAFLAG=-mzarch
fi
cat > $test.c <<EOF
#ifndef __s390x__
#error
#endif
#include <vecintrin.h>
int main(void) {
unsigned long long a __attribute__((vector_size(16))) = { 0 };
unsigned long long b __attribute__((vector_size(16))) = { 0 };
unsigned char c __attribute__((vector_size(16))) = { 0 };
c = vec_gfmsum_accum_128(a, b, c);
return c[0];
}
EOF
# cflags already contains a valid march
if try $CC -c $CFLAGS $VGFMAFLAG $test.c; then
echo "Checking for s390x vx vector extension ... Yes." | tee -a configure.log
HAVE_S390X_VX=1
# or set march for our compile units
elif try $CC -c $CFLAGS $VGFMAFLAG -march=z13 $test.c; then
echo "Checking for s390x vx vector extension (march=z13) ... Yes." | tee -a configure.log
HAVE_S390X_VX=1
VGFMAFLAG="$VGFMAFLAG -march=z13"
# else we are not on s390x
else
echo "Checking for s390x vx vector extension ... No." | tee -a configure.log
fi
# prepare compiling for s390x
if test $HAVE_S390X_VX -eq 1; then
CFLAGS="$CFLAGS -DHAVE_S390X_VX"
SFLAGS="$SFLAGS -DHAVE_S390X_VX"
OBJC="$OBJC crc32_vx.o"
PIC_OBJC="$PIC_OBJC crc32_vx.lo"
else
# target has no vx extension
VGFMAFLAG=""
fi
fi
# show the results in the log
echo >> configure.log
echo ALL = $ALL >> configure.log
@@ -1010,15 +866,10 @@ echo mandir = $mandir >> configure.log
echo prefix = $prefix >> configure.log
echo sharedlibdir = $sharedlibdir >> configure.log
echo uname = $uname >> configure.log
echo HAVE_S390X = $HAVE_S390X >> configure.log
echo HAVE_S390X_VX = $HAVE_S390X_VX >> configure.log
echo VGFMAFLAG = $VGFMAFLAG >> configure.log
# update Makefile with the configure results
sed < ${SRCDIR}Makefile.in "
/^CC *=/s#=.*#=$CC#
/^GCOV *=/s#=.*#=$GCOV#
/^LLVM_GCOV_FLAG *=/s#=.*#=$LLVM_GCOV_FLAG#
/^CFLAGS *=/s#=.*#=$CFLAGS#
/^SFLAGS *=/s#=.*#=$SFLAGS#
/^LDFLAGS *=/s#=.*#=$LDFLAGS#
-61
View File
@@ -1,61 +0,0 @@
function(zlib_add_contrib_lib name description dir)
option(ZLIB_BUILD_${name} "Enable building of ${description}" OFF)
if(ZLIB_BUILD_${name})
if(NOT DEFINED ZLIB_${name}_BUILD_SHARED)
set(ZLIB_${name}_BUILD_SHARED ${ZLIB_BUILD_SHARED} CACHE BOOL "")
endif(NOT DEFINED ZLIB_${name}_BUILD_SHARED)
if(NOT DEFINED ZLIB_${name}_BUILD_STATIC)
set(ZLIB_${name}_BUILD_STATIC ${ZLIB_BUILD_STATIC} CACHE BOOL "")
endif(NOT DEFINED ZLIB_${name}_BUILD_STATIC)
if(NOT DEFINED ZLIB_${name}_BUILD_TESTING)
set(ZLIB_${name}_BUILD_TESTING ${ZLIB_BUILD_TESTING} CACHE BOOL "")
endif(NOT DEFINED ZLIB_${name}_BUILD_TESTING)
if(NOT DEFINED ZLIB_${name}_INSTALL)
set(ZLIB_${name}_INSTALL ${ZLIB_INSTALL} CACHE BOOL "")
endif(NOT DEFINED ZLIB_${name}_INSTALL)
add_subdirectory(${dir}/)
endif(ZLIB_BUILD_${name})
endfunction(zlib_add_contrib_lib name description dir)
function(zlib_add_contrib_feature name description dir)
if(ARGC EQUAL 4)
set(default_on ${ARGV3})
else()
set(default_on Off)
endif()
option(ZLIB_WITH_${name}
"Enable build ${description}"
${default_on})
if(ZLIB_WITH_${name})
add_subdirectory(${dir}/)
endif(ZLIB_WITH_${name})
endfunction(zlib_add_contrib_feature name description dir)
zlib_add_contrib_feature("GVMAT64"
"of an optimized longest_match for 32 bits x86_64"
gcc_gvmat64)
zlib_add_contrib_feature(INFBACK9 "with support for method 9 deflate" infback9)
zlib_add_contrib_feature(CRC32VX "with S390X-CRC32VX implementation" crc32vx)
zlib_add_contrib_lib(ADA "Ada bindings" ada)
zlib_add_contrib_lib(BLAST "blast binary" blast)
zlib_add_contrib_lib(IOSTREAM3 "IOStream C++ bindings V3" iostream3)
zlib_add_contrib_lib(MINIZIP "minizip library" minizip)
zlib_add_contrib_lib(PUFF "puff decompress library" puff)
if(WIN32)
zlib_add_contrib_lib(TESTZLIB "testzlib binary" testzlib)
if (ZLIB_BUILD_ZLIB1_DLL)
add_subdirectory(zlib1-dll/)
endif (ZLIB_BUILD_ZLIB1_DLL)
option(ZLIB_BUILD_ZLIB1_DLL "Build the legacy zlib + minizip DLL" OFF)
endif(WIN32)
+8 -8
View File
@@ -6,7 +6,7 @@ for help about these, not the zlib authors. Thanks.
ada/ by Dmitriy Anisimkov <anisimkov@yahoo.com>
Support for Ada
See https://zlib-ada.sourceforge.net/
See http://zlib-ada.sourceforge.net/
blast/ by Mark Adler <madler@alumni.caltech.edu>
Decompressor for output of PKWare Data Compression Library (DCL)
@@ -37,7 +37,7 @@ iostream3/ by Ludwig Schwardt <schwardt@sun.ac.za>
minizip/ by Gilles Vollant <info@winimage.com>
Mini zip and unzip based on zlib
Includes Zip64 support by Mathias Svensson <mathias@result42.com>
See https://www.winimage.com/zLibDll/minizip.html
See http://www.winimage.com/zLibDll/minizip.html
pascal/ by Bob Dellaca <bobdl@xtra.co.nz> et al.
Support for Pascal
@@ -46,12 +46,12 @@ puff/ by Mark Adler <madler@alumni.caltech.edu>
Small, low memory usage inflate. Also serves to provide an
unambiguous description of the deflate format.
crc32vx/ by Ilya Leoshkevich <iii@linux.ibm.com>
Hardware-accelerated CRC32 on IBM Z with Z13 VX extension.
testzlib/ by Gilles Vollant <info@winimage.com>
Example of the use of zlib
zlib1-dll/
by @Vollstrecker on github.com
Build the legacy zlib1.dll with zlib and minizip.
untgz/ by Pedro A. Aranda Gutierrez <paag@tid.es>
A very simple tar.gz file extractor using zlib
vstudio/ by Gilles Vollant <info@winimage.com>
Building a minizip-enhanced zlib with Microsoft Visual Studio
Includes vc11 from kreuzerkrieg and vc12 from davispuh
-217
View File
@@ -1,217 +0,0 @@
cmake_minimum_required(VERSION 3.12...3.31)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
project(
zlibAda
VERSION 1.0.0
LANGUAGES C ADA
DESCRIPTION "A library for creating zipfiles based in zlib"
HOMEPAGE_URL "https://www.zlib.net")
option(ZLIB_ADA_BUILD_SHARED "Enable building ada bindings shared library" ON)
option(ZLIB_ADA_BUILD_STATIC "Enable building ada bindings static library" ON)
option(ZLIB_ADA_BUILD_TESTING "Enable building tests for ada bindings library" ON)
if(WIN32 OR CYGWIN)
set(zlib_Ada_static_suffix "s")
set(CMAKE_DEBUG_POSTFIX "d")
endif(WIN32 OR CYGWIN)
if(NOT DEFINED ZLIB_BUILD_ADA)
if(ZLIB_ADA_BUILD_SHARED)
list(APPEND REQUIRED_COMPONENTS "shared")
endif(ZLIB_ADA_BUILD_SHARED)
if(ZLIB_ADA_BUILD_STATIC)
list(APPEND REQUIRED_COMPONENTS "static")
endif(ZLIB_ADA_BUILD_STATIC)
find_package(ZLIB REQUIRED COMPONENTS ${REQUIRED_COMPONENTS} CONFIG)
endif(NOT DEFINED ZLIB_BUILD_ADA)
function(ZLIB_ADA_findTestEnv testName)
set(testEnv "PATH=")
if(MSVC OR MINGW)
set(separator "\\\;")
else()
set(separator ":")
endif()
string(APPEND testEnv "$<TARGET_FILE_DIR:ZLIB::ZLIB>${separator}")
string(APPEND testEnv "$ENV{PATH}")
set_tests_properties(${testName} PROPERTIES ENVIRONMENT "${testEnv}")
endfunction(ZLIB_ADA_findTestEnv testName)
if(ZLIB_ADA_BUILD_SHARED)
ada_add_library(zlib_ada_Ada SHARED
zlib-thin.adb
zlib.adb)
set_target_properties(zlib_ada_Ada
PROPERTIES OUTPUT_NAME zlib-ada)
target_link_libraries(zlib_ada_Ada
INTERFACE ZLIB::ZLIB)
ada_add_library(zlib_ada_streams SHARED
zlib-streams.adb)
target_link_libraries(zlib_ada_streams
PUBLIC
zlib_ada_Ada)
ada_find_ali(zlib_ada_streams)
if(ZLIB_ADA_BUILD_TESTING)
enable_testing()
ada_add_executable(zlib_ada_test test.adb)
target_link_libraries(zlib_ada_test
PRIVATE
zlib_ada_Ada
zlib_ada_streams)
ada_find_ali(zlib_ada_test)
add_test(NAME zlib_ada_ada-test COMMAND zlib_ada_test)
set_tests_properties(zlib_ada_ada-test PROPERTIES FIXTURES_REQUIRED zlib_ada_cleanup)
if(MSVC
OR MSYS
OR MINGW
OR CYGWIN)
zlib_ada_findtestenv(zlib_ada_ada-test)
endif(
MSVC
OR MSYS
OR MINGW
OR CYGWIN)
ada_add_executable(zlib_ada_buffer_demo buffer_demo.adb)
target_link_libraries(zlib_ada_buffer_demo
PRIVATE
zlib_ada_Ada)
ada_find_ali(zlib_ada_buffer_demo)
add_test(NAME zlib_ada_buffer-demo COMMAND zlib_ada_buffer_demo)
if(MSVC
OR MSYS
OR MINGW
OR CYGWIN)
zlib_ada_findtestenv(zlib_ada_buffer-demo)
endif(
MSVC
OR MSYS
OR MINGW
OR CYGWIN)
ada_add_executable(zlib_ada_mtest mtest.adb)
target_link_libraries(zlib_ada_mtest
PRIVATE
zlib_ada_Ada)
ada_find_ali(zlib_ada_mtest)
#Not adding test as this is an endless-loop
ada_add_executable(zlib_ada_read read.adb)
target_link_libraries(zlib_ada_read
PRIVATE
zlib_ada_Ada)
ada_find_ali(zlib_ada_read)
add_test(NAME zlib_ada_read COMMAND zlib_ada_read)
if(MSVC
OR MSYS
OR MINGW
OR CYGWIN)
zlib_ada_findtestenv(zlib_ada_read)
endif(
MSVC
OR MSYS
OR MINGW
OR CYGWIN)
endif(ZLIB_ADA_BUILD_TESTING)
endif(ZLIB_ADA_BUILD_SHARED)
if(ZLIB_ADA_BUILD_STATIC)
ada_add_library(zlib_ada_AdaStatic STATIC
zlib-thin.adb
zlib.adb)
target_link_libraries(zlib_ada_AdaStatic
INTERFACE ZLIB::ZLIBSTATIC)
set_target_properties(zlib_ada_AdaStatic
PROPERTIES OUTPUT_NAME zlib-ada${zlib_Ada_static_suffix})
ada_add_library(zlib_ada_streamsStatic STATIC
zlib-streams.adb)
target_link_libraries(zlib_ada_streamsStatic
PUBLIC
zlib_ada_AdaStatic)
ada_find_ali(zlib_ada_streamsStatic)
if(ZLIB_ADA_BUILD_TESTING)
enable_testing()
ada_add_executable(zlib_ada_testStatic test.adb)
target_link_libraries(zlib_ada_testStatic
PRIVATE
zlib_ada_AdaStatic
zlib_ada_streamsStatic)
ada_find_ali(zlib_ada_testStatic)
add_test(NAME zlib_ada_testStatic COMMAND zlib_ada_testStatic)
set_tests_properties(zlib_ada_testStatic PROPERTIES FIXTURES_REQUIRED zlib_ada_cleanup)
ada_add_executable(zlib_ada_buffer-demoStatic buffer_demo.adb)
target_link_libraries(zlib_ada_buffer-demoStatic
PRIVATE
zlib_ada_AdaStatic)
ada_find_ali(zlib_ada_buffer-demoStatic)
add_test(NAME zlib_ada_buffer-demoStatic COMMAND zlib_ada_buffer-demoStatic)
ada_add_executable(zlib_ada_mtestStatic mtest.adb)
target_link_libraries(zlib_ada_mtestStatic
PRIVATE
zlib_ada_AdaStatic)
ada_find_ali(zlib_ada_mtestStatic)
# Not adding test as this is an endless-loop
ada_add_executable(zlib_ada_readStatic read.adb)
target_link_libraries(zlib_ada_readStatic
PRIVATE
zlib_ada_AdaStatic)
ada_find_ali(zlib_ada_readStatic)
add_test(NAME zlib_ada_readStatic COMMAND zlib_ada_readStatic)
endif(ZLIB_ADA_BUILD_TESTING)
endif(ZLIB_ADA_BUILD_STATIC)
if(ZLIB_ADA_BUILD_TESTING)
add_test(NAME zlib_ada_cleanup COMMAND ${CMAKE_COMMAND} -E rm ${CMAKE_CURRENT_BINARY_DIR}/testzlib.in
${CMAKE_CURRENT_BINARY_DIR}/testzlib.out ${CMAKE_CURRENT_BINARY_DIR}/testzlib.zlb)
set_tests_properties(zlib_ada_cleanup PROPERTIES FIXTURES_CLEANUP zlib_ada_cleanup)
endif(ZLIB_ADA_BUILD_TESTING)
@@ -1,23 +0,0 @@
set(CMAKE_ADA_COMPILER "@CMAKE_ADA_COMPILER@")
set(CMAKE_ADA_COMPILER_ARG1 "@CMAKE_ADA_COMPILER_ARG1@")
set(CMAKE_ADA_COMPILER_ID "@CMAKE_ADA_COMPILER_ID@")
set(CMAKE_ADA_COMPILER_VERSION "@CMAKE_ADA_COMPILER_VERSION@")
set(CMAKE_ADA_PLATFORM_ID "@CMAKE_ADA_PLATFORM_ID@")
set(CMAKE_AR "@CMAKE_AR@")
#set(CMAKE_RANLIB "@CMAKE_RANLIB@")
#set(CMAKE_LINKER "@CMAKE_LINKER@")
set(CMAKE_ADA_COMPILER_LOADED TRUE)
set(CMAKE_ADA_COMPILER_WORKS @CMAKE_ADA_COMPILER_WORKS@)
#set(CMAKE_ADA_ABI_COMPILED @CMAKE_ADA_ABI_COMPILED@)
set(CMAKE_ADA_COMPILER_ENV_VAR "ADA")
set(CMAKE_ADA_COMPILER_ID_RUN TRUE)
set(CMAKE_ADA_SOURCE_FILE_EXTENSIONS adb;ADB)
set(CMAKE_ADA_IGNORE_EXTENSIONS ;o;O;obj;OBJ;ali)
set(CMAKE_ADA_BINDER_HELPER "@CMAKE_ADA_BINDER_HELPER@")
set(CMAKE_ADA_COMPILER_HELPER "@CMAKE_ADA_COMPILER_HELPER@")
set(CMAKE_ADA_EXE_LINK_HELPER "@CMAKE_ADA_EXE_LINK_HELPER@")
set(CMAKE_ADA_SHARED_LINK_HELPER "@CMAKE_ADA_SHARED_LINK_HELPER@")
set(CMAKE_ADA_STATIC_LINK_HELPER "@CMAKE_ADA_STATIC_LINK_HELPER@")
@@ -1,133 +0,0 @@
include(CMakeLanguageInformation)
set(CMAKE_ADA_OUTPUT_EXTENSION .o)
set(CMAKE_ADA_OUTPUT_EXTENSION_REPLACE TRUE)
if(CMAKE_USER_MAKE_RULES_OVERRIDE)
include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
endif(CMAKE_USER_MAKE_RULES_OVERRIDE)
if(CMAKE_USER_MAKE_RULES_OVERRIDE_ADA)
include(${CMAKE_USER_MAKE_RULES_OVERRIDE_ADA} RESULT_VARIABLE _override)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_ADA "${_override}")
endif(CMAKE_USER_MAKE_RULES_OVERRIDE_ADA)
set(CMAKE_ADA_FLAGS_INIT "$ENV{ADAFLAGS} ${CMAKE_ADA_FLAGS_INIT}")
string(APPEND CMAKE_ADA_FLAGS_INIT " ")
string(APPEND CMAKE_ADA_FLAGS_DEBUG_INIT " -g")
string(APPEND CMAKE_ADA_FLAGS_MINSIZEREL_INIT " -Os")
string(APPEND CMAKE_ADA_FLAGS_RELEASE_INIT " -O3")
string(APPEND CMAKE_ADA_FLAGS_RELWITHDEBINFO_INIT " -O2 -g")
cmake_initialize_per_config_variable(CMAKE_ADA_FLAGS "Flags used by the Ada compiler")
if(CMAKE_ADA_STANDARD_LIBRARIES_INIT)
set(CMAKE_ADA_STANDARD_LIBRARIES
"${CMAKE_ADA_STANDARD_LIBRARIES_INIT}"
CACHE
STRING "Libraries linked by default with all Ada applications.")
mark_as_advanced(CMAKE_ADA_STANDARD_LIBRARIES)
endif(CMAKE_ADA_STANDARD_LIBRARIES_INIT)
if(NOT CMAKE_ADA_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_ADA_COMPILER_LAUNCHER})
set(CMAKE_ADA_COMPILER_LAUNCHER
"$ENV{CMAKE_ADA_COMPILER_LAUNCHER}"
CACHE
STRING "Compiler launcher for Ada.")
endif(NOT CMAKE_ADA_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_ADA_COMPILER_LAUNCHER})
if(NOT CMAKE_ADA_LINKER_LAUNCHER AND DEFINED ENV{CMAKE_ADA_LINKER_LAUNCHER})
set(CMAKE_ADA_LINKER_LAUNCHER
"$ENV{CMAKE_ADA_LINKER_LAUNCHER}"
CACHE
STRING "Linker launcher for Ada.")
endif(NOT CMAKE_ADA_LINKER_LAUNCHER AND DEFINED ENV{CMAKE_ADA_LINKER_LAUNCHER})
include(CMakeCommonLanguageInclude)
_cmake_common_language_platform_flags(ADA)
if(NOT CMAKE_ADA_CREATE_SHARED_LIBRARY)
set(CMAKE_ADA_CREATE_SHARED_LIBRARY
"${CMAKE_ADA_BINDER_HELPER} <CMAKE_ADA_COMPILER> <OBJECTS> FLAGS <FLAGS> <LINK_FLAGS>"
"${CMAKE_ADA_SHARED_LINK_HELPER} <CMAKE_ADA_COMPILER> <TARGET> <OBJECTS> <LINK_LIBRARIES>")
endif(NOT CMAKE_ADA_CREATE_SHARED_LIBRARY)
if(NOT CMAKE_ADA_CREATE_STATIC_LIBRARY)
set(CMAKE_ADA_CREATE_STATIC_LIBRARY
"${CMAKE_ADA_STATIC_LINK_HELPER} ${CMAKE_AR} <TARGET> <OBJECTS>")
endif(NOT CMAKE_ADA_CREATE_STATIC_LIBRARY)
if(NOT CMAKE_ADA_COMPILE_OBJECT)
set(CMAKE_ADA_COMPILE_OBJECT
"${CMAKE_ADA_COMPILER_HELPER} <CMAKE_ADA_COMPILER> <OBJECT_DIR> <SOURCE> <FLAGS>")
endif(NOT CMAKE_ADA_COMPILE_OBJECT)
if(NOT CMAKE_ADA_LINK_EXECUTABLE)
set(CMAKE_ADA_LINK_EXECUTABLE
"${CMAKE_ADA_BINDER_HELPER} <CMAKE_ADA_COMPILER> <OBJECTS> FLAGS <FLAGS> <LINK_FLAGS>"
"${CMAKE_ADA_EXE_LINK_HELPER} <CMAKE_ADA_COMPILER> <TARGET> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> OBJ <OBJECTS> LIBS <LINK_LIBRARIES>")
endif(NOT CMAKE_ADA_LINK_EXECUTABLE)
function(ada_add_executable)
if(ARGC GREATER 1)
math(EXPR last_index "${ARGC} - 1")
foreach(source RANGE 1 ${last_index})
list(APPEND SOURCES ${ARGV${source}})
string(REPLACE ".adb" "" ali "${ARGV${source}}")
set(clean_file "CMakeFiles/${ARGV0}.dir/${ali}.ali")
list(APPEND CLEAN_FILES ${clean_file})
list(APPEND CLEAN_FILES b~${ali}.adb)
list(APPEND CLEAN_FILES b~${ali}.ads)
list(APPEND CLEAN_FILES b~${ali}.ali)
list(APPEND CLEAN_FILES b~${ali}.o)
endforeach(source RANGE 1 ${ARGC})
add_executable(${ARGV0} ${ARGV1} ${SOURCES})
set_target_properties(${ARGV0}
PROPERTIES
ADDITIONAL_CLEAN_FILES "${CLEAN_FILES}")
endif(ARGC GREATER 1)
endfunction(ada_add_executable)
function(ada_add_library)
if(ARGC GREATER 2)
math(EXPR last_index "${ARGC} - 1")
foreach(source RANGE 2 ${last_index})
list(APPEND SOURCES ${ARGV${source}})
string(REPLACE ".adb" "" ali "${ARGV${source}}")
set(clean_file "CMakeFiles/${ARGV0}.dir/${ali}.ali")
list(APPEND CLEAN_FILES ${clean_file})
list(APPEND CLEAN_FILES b~${ali}.adb)
list(APPEND CLEAN_FILES b~${ali}.ads)
list(APPEND CLEAN_FILES b~${ali}.ali)
list(APPEND CLEAN_FILES b~${ali}.o)
endforeach(source RANGE 2 ${ARGC})
add_library(${ARGV0} ${ARGV1} ${SOURCES})
set_target_properties(${ARGV0}
PROPERTIES
ADDITIONAL_CLEAN_FILES "${CLEAN_FILES};dummylib.adb;dummylib.ali;dummylib.o"
ALI_FLAG "-aO${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${ARGV0}.dir/")
endif(ARGC GREATER 2)
endfunction(ada_add_library)
function(ada_find_ali)
get_target_property(link_libs ${ARGV0} LINK_LIBRARIES)
foreach(lib IN LISTS link_libs)
get_target_property(ali ${lib} ALI_FLAG)
string(APPEND FLAGS ${ali} " ")
unset(ali)
endforeach(lib IN LISTS link_libs)
set_target_properties(${ARGV0}
PROPERTIES
LINK_FLAGS ${FLAGS})
endfunction(ada_find_ali)
set(CMAKE_ADA_INFORMATION_LOADED TRUE)
@@ -1,33 +0,0 @@
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
# Load system-specific compiler preferences for this language.
include(Platform/${CMAKE_SYSTEM_NAME}-Determine-Ada OPTIONAL)
include(Platform/${CMAKE_SYSTEM_NAME}-Ada OPTIONAL)
if(NOT CMAKE_ADA_COMPILER_NAMES)
set(CMAKE_ADA_COMPILER_NAMES gnat)
foreach(ver RANGE 11 99)
list(APPEND CMAKE_ADA_COMPILER_NAMES gnat-${ver})
endforeach(ver RANGE 11 99)
endif(NOT CMAKE_ADA_COMPILER_NAMES)
if(NOT CMAKE_ADA_COMPILER)
set(CMAKE_ADA_COMPILER_INIT NOTFOUND)
_cmake_find_compiler(ADA)
else(NOT CMAKE_REAL_ADA_COMPILER)
_cmake_find_compiler_path(ADA)
endif(NOT CMAKE_ADA_COMPILER)
mark_as_advanced(CMAKE_ADA_COMPILER)
set(CMAKE_ADA_COMPILER_ID "GNU")
set(CMAKE_ADA_BINDER_HELPER "${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/binder_helper.cmake")
set(CMAKE_ADA_COMPILER_HELPER "${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/compile_helper.cmake")
set(CMAKE_ADA_EXE_LINK_HELPER "${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/exe_link_helper.cmake")
set(CMAKE_ADA_SHARED_LINK_HELPER "${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/shared_link_helper.cmake")
set(CMAKE_ADA_STATIC_LINK_HELPER "${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/static_link_helper.cmake")
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/CMakeADACompiler.cmake.in
${CMAKE_PLATFORM_INFO_DIR}/CMakeADACompiler.cmake
@ONLY)
@@ -1,46 +0,0 @@
include(CMakeTestCompilerCommon)
unset(CMAKE_ADA_COMPILER_WORKS CACHE)
if(NOT CMAKE_ADA_COMPILER_WORKS)
PrintTestCompilerStatus("ADA" "")
set(_ADA_TEST_FILE "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.adb")
file(WRITE ${_ADA_TEST_FILE}
"with Ada.Text_IO; use Ada.Text_IO;\n"
"\n"
"procedure main is\n"
"begin\n"
"Put_Line(\"Hello, World!\");\n"
"end Main;\n")
try_compile(CMAKE_ADA_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${_ADA_TEST_FILE}
OUTPUT_VARIABLE __CMAKE_ADA_COMPILER_OUTPUT)
set(CMAKE_ADA_COMPILER_WORKS ${CMAKE_ADA_COMPILER_WORKS})
unset(CMAKE_ADA_COMPILER_WORKS CACHE)
set(ADA_TEST_WAS_RUN TRUE)
endif(NOT CMAKE_ADA_COMPILER_WORKS)
if(NOT CMAKE_ADA_COMPILER_WORKS)
PrintTestCompilerStatus("ADA" " -- broken")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the Ada compiler works failed with "
"the following output:\n${__CMAKE_ADA_COMPILER_OUTPUT}\n\n")
message(FATAL_ERROR "The Ada compiler \"${CMAKE_ADA_COMPILER}\" "
"is not able to compile a simple test program.\nIt fails "
"with the following output:\n ${__CMAKE_ADA_COMPILER_OUTPUT}\n\n"
"CMake will not be able to correctly generate this project.")
else(NOT CMAKE_ADA_COMPILER_WORKS)
if(ADA_TEST_WAS_RUN)
PrintTestCompilerStatus("ADA" " -- works")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Ada compiler works passed with "
"the following output:\n${__CMAKE_ADA_COMPILER_OUTPUT}\n\n")
endif(ADA_TEST_WAS_RUN)
endif(NOT CMAKE_ADA_COMPILER_WORKS)
unset(__CMAKE_ADA_COMPILER_OUTPUT)
@@ -1,47 +0,0 @@
#CMAKE_ARGV0 = /path/to/cmake
#CMAKE_ARGV1 = -P
#CMAKE_ARGV2 = path/to/this/file
#CMAKE_ARGV3 = binder
#CMAKE_ARGV4 = ali
if(NOT CMAKE_ARGV3)
message(FATAL_ERROR "binder not set")
endif(NOT CMAKE_ARGV3)
string(REPLACE ".o" ".ali" ALI ${CMAKE_ARGV4})
set (REACHED_FLAGS FALSE)
#iterate over additional objects, only the main one is needed
foreach(arg RANGE 5 ${CMAKE_ARGC})
if(CMAKE_ARGV${arg} STREQUAL FLAGS)
set(REACHED_FLAGS TRUE)
continue()
endif(CMAKE_ARGV${arg} STREQUAL FLAGS)
string(SUBSTRING "${CMAKE_ARGV${arg}}" 0 2 start)
if(start STREQUAL "-O")
continue()
endif(start STREQUAL "-O")
if(REACHED_FLAGS)
list(APPEND FLAGS ${CMAKE_ARGV${arg}})
endif(REACHED_FLAGS)
endforeach(arg RANGE 5 CMAKE_ARGC)
#first see if there is a main function
execute_process(COMMAND ${CMAKE_ARGV3} bind ${ALI} ${FLAGS}
RESULT_VARIABLE MAIN_RESULT
OUTPUT_VARIABLE dont_care
ERROR_VARIABLE ERROR)
if(MAIN_RESULT)
execute_process(COMMAND ${CMAKE_ARGV3} bind -n ${ALI} ${FLAGS}
RESULT_VARIABLE RESULT
OUTPUT_VARIABLE dont_care
ERROR_VARIABLE ERROR)
endif(MAIN_RESULT)
if(RESULT)
message(FATAL_ERROR ${RESULT} ${ERROR})
endif(RESULT)
@@ -1,32 +0,0 @@
#CMAKE_ARGV0 = /path/to/cmake
#CMAKE_ARGV1 = -P
#CMAKE_ARGV2 = path/to/this/file
#CMAKE_ARGV3 = compiler
#CMAKE_ARGV4 = OBJECT-DIR
#CMAKE_ARGV5 = source-file
if(NOT CMAKE_ARGV3)
message(FATAL_ERROR "compiler not set")
endif(NOT CMAKE_ARGV3)
if(NOT CMAKE_ARGV4)
message(FATAL_ERROR "object dir not set")
endif(NOT CMAKE_ARGV4)
if(NOT CMAKE_ARGV5)
message(FATAL_ERROR "source not set")
endif(NOT CMAKE_ARGV5)
foreach(arg RANGE 6 ${CMAKE_ARGC})
list(APPEND FLAGS "${CMAKE_ARGV${arg}}")
endforeach(arg RANGE 6 ${CMAKE_ARGC})
execute_process(COMMAND ${CMAKE_ARGV3} compile ${FLAGS} ${CMAKE_ARGV5}
WORKING_DIRECTORY ${CMAKE_ARGV4}
RESULT_VARIABLE RESULT
OUTPUT_VARIABLE dont_care
ERROR_VARIABLE ERROR)
if(RESULT)
message(FATAL_ERROR ${RESULT} ${ERROR})
endif(RESULT)
@@ -1,53 +0,0 @@
#CMAKE_ARGV0 = /path/to/cmake
#CMAKE_ARGV1 = -P
#CMAKE_ARGV2 = path/to/this/file
#CMAKE_ARGV3 = linker
#CMAKE_ARGV4 = output-name
#CMAKE_ARGV5...CMAKE_AGVN = OBJECTS
#CMAKE_ARGVN+1 = LIBS
#CMAKE_ARGVN+2...CMAKE_ARGVM libraries
if(NOT CMAKE_ARGV3)
message(FATAL_ERROR "linker not set")
endif(NOT CMAKE_ARGV3)
set(REACHED_LIBS FALSE)
set(REACHED_OBJ FALSE)
foreach(arg RANGE 5 ${CMAKE_ARGC})
if(CMAKE_ARGV${arg} STREQUAL LIBS)
set(REACHED_LIBS TRUE)
set(REACHED_OBJ FALSE)
continue()
endif(CMAKE_ARGV${arg} STREQUAL LIBS)
if(CMAKE_ARGV${arg} STREQUAL OBJ)
set(REACHED_LIBS FALSE)
set(REACHED_OBJ TRUE)
continue()
endif(CMAKE_ARGV${arg} STREQUAL OBJ)
if(CMAKE_ARGC EQUAL arg)
continue()
endif(CMAKE_ARGC EQUAL arg)
if(REACHED_LIBS)
list(APPEND LIBS "${CMAKE_ARGV${arg}}")
elseif(REACHED_OBJ AND NOT ALI)
string(REPLACE ".o" ".ali" ALI "${CMAKE_ARGV${arg}}")
else(REACHED_LIBS)
string(SUBSTRING "${CMAKE_ARGV${arg}}" 0 3 start)
if(NOT start STREQUAL -aO)
list(APPEND FLAGS "${CMAKE_ARGV${arg}}")
endif(NOT start STREQUAL -aO)
endif(REACHED_LIBS)
endforeach(arg RANGE 5 ${CMAKE_ARGC})
execute_process(COMMAND ${CMAKE_ARGV3} link ${ALI} -o ${CMAKE_ARGV4} ${FLAGS} ${OTHER_OBJECTS} ${LIBS}
RESULT_VARIABLE RESULT
OUTPUT_VARIABLE dont_care
ERROR_VARIABLE ERROR)
if(RESULT)
message(FATAL_ERROR ${RESULT} ${ERROR})
endif(RESULT)
@@ -1,52 +0,0 @@
#CMAKE_ARGV0 = /path/to/cmake
#CMAKE_ARGV1 = -P
#CMAKE_ARGV2 = path/to/this/file
#CMAKE_ARGV3 = linker
#CMAKE_ARGV4 = output-name
#CMAKE_ARGV5...CMAKE_AGVN = OBJECTS
#CMAKE_ARGVN+1 = LIBS
#CMAKE_ARGVN+2...CMAKE_ARGVM libraries
if(NOT CMAKE_ARGV3)
message(FATAL_ERROR "linker not set")
endif(NOT CMAKE_ARGV3)
set(REACHED_FILES FALSE)
foreach(arg RANGE 5 ${CMAKE_ARGC})
if(CMAKE_ARGV${arg} STREQUAL "LIBS")
set(REACHED_FILES TRUE)
continue()
endif(CMAKE_ARGV${arg} STREQUAL "LIBS")
if(CMAKE_ARGC EQUAL arg)
continue()
endif(CMAKE_ARGC EQUAL arg)
if(REACHED_LIBS)
list(APPEND LIBS "${CMAKE_ARGV${arg}} ")
else(REACHED_LIBS)
list(APPEND OBJECT_FILES "${CMAKE_ARGV${arg}}")
endif(REACHED_LIBS)
endforeach(arg RANGE 5 ${CMAKE_ARGC})
file(WRITE dummylib.adb
"procedure dummylib is\n"
"begin\n"
" null;\n"
"end;\n")
execute_process(COMMAND ${CMAKE_ARGV3} compile -fPIC dummylib.adb
OUTPUT_VARIABLE dont_care
ERROR_VARIABLE ERROR)
execute_process(COMMAND ${CMAKE_ARGV3} bind -n dummylib.ali
OUTPUT_VARIABLE dont_care
ERROR_VARIABLE ERROR)
execute_process(COMMAND ${CMAKE_ARGV3} link -shared dummylib.ali -o ${CMAKE_ARGV4} ${OBJECT_FILES} ${LIBS}
RESULT_VARIABLE RESULT
OUTPUT_VARIABLE dont_care
ERROR_VARIABLE ERROR)
if(RESULT)
message(FATAL_ERROR ${RESULT} ${ERROR})
endif(RESULT)
@@ -1,25 +0,0 @@
#CMAKE_ARGV0 = /path/to/cmake
#CMAKE_ARGV1 = -P
#CMAKE_ARGV2 = path/to/this/file
#CMAKE_ARGV3 = path/to/ar
#CMAKE_ARGV4 = output-name
#CMAKE_ARGV5...CMAKE_AGVN = OBJECTS
if(NOT CMAKE_ARGV3)
message(FATAL_ERROR "linker not set")
endif(NOT CMAKE_ARGV3)
foreach(arg RANGE 5 ${CMAKE_ARGC})
if(NOT CMAKE_ARGC EQUAL arg)
list(APPEND OBJECT_FILES "${CMAKE_ARGV${arg}}")
endif(NOT CMAKE_ARGC EQUAL arg)
endforeach(arg RANGE 6 ${CMAKE_ARGC})
execute_process(COMMAND ${CMAKE_ARGV3} rcs ${CMAKE_ARGV4} ${OBJECT_FILES}
RESULT_VARIABLE RESULT
OUTPUT_VARIABLE dont_care
ERROR_VARIABLE ERROR)
if(RESULT)
message(FATAL_ERROR ${RESULT} ${ERROR})
endif(RESULT)
+2 -2
View File
@@ -2,7 +2,7 @@
Release 1.3
ZLib.Ada is a thick binding interface to the popular ZLib data
compression library, available at https://zlib.net/.
compression library, available at http://www.gzip.org/zlib/.
It provides Ada-style access to the ZLib C library.
@@ -59,7 +59,7 @@ the main functionality of ZLib.Ada.
The routines from the package specifications are commented.
Homepage: https://zlib-ada.sourceforge.net/
Homepage: http://zlib-ada.sourceforge.net/
Author: Dmitriy Anisimkov <anisimkov@yahoo.com>
Contributors: Pascal Obry <pascal@obry.org>, Steve Sangwine <sjs@essex.ac.uk>
+1 -2
View File
@@ -12,8 +12,7 @@ package body ZLib.Thin is
ZLIB_VERSION : constant Chars_Ptr := zlibVersion;
Dummy : Z_Stream;
Z_Stream_Size : constant Int := Dummy'Size / System.Storage_Unit;
Z_Stream_Size : constant Int := Z_Stream'Size / System.Storage_Unit;
--------------
-- Avail_In --
+3 -3
View File
@@ -145,7 +145,7 @@ LastMatchGood:
movl %eax, %ebx
LookaheadLess: movl %ebx, nicematch(%esp)
/* Bytef *scan = s->window + s->strstart; */
/* register Bytef *scan = s->window + s->strstart; */
movl dsWindow(%edx), %esi
movl %esi, window(%esp)
@@ -181,8 +181,8 @@ LimitPositive:
addl %eax, %esi
movl %esi, windowbestlen(%esp)
/* ush scan_start = *(ushf*)scan; */
/* ush scan_end = *(ushf*)(scan+best_len-1); */
/* register ush scan_start = *(ushf*)scan; */
/* register ush scan_end = *(ushf*)(scan+best_len-1); */
/* Posf *prev = s->prev; */
movzwl (%edi), %ebx
-166
View File
@@ -1,166 +0,0 @@
cmake_minimum_required(VERSION 3.12...3.31)
project(
blast
VERSION 1.3.0
LANGUAGES C
DESCRIPTION "A library for creating zipfiles based in zlib"
HOMEPAGE_URL "https://www.zlib.net")
option(ZLIB_BLAST_BUILD_SHARED "Enable building blast shared library" ON)
option(ZLIB_BLAST_BUILD_STATIC "Enable building blast static library" ON)
option(ZLIB_BLAST_BUILD_TESTING "Enable building tests for blast" ON)
option(ZLIB_BLAST_INSTALL "Enable installation of blast" ON)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
if(WIN32 OR CYGWIN)
set(zlibblast_static_suffix "s")
set(CMAKE_DEBUG_POSTFIX "d")
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif(WIN32 OR CYGWIN)
function(blast_findTestEnv testName)
set(testEnv "PATH=")
if(MSVC OR MINGW)
set(separator "\\\;")
else()
set(separator ":")
endif()
string(APPEND testEnv "$<TARGET_FILE_DIR:BLAST::BLAST>${separator}")
string(APPEND testEnv "$ENV{PATH}")
set_tests_properties(${testName} PROPERTIES ENVIRONMENT "${testEnv}")
endfunction(blast_findTestEnv testName)
if(ZLIB_BLAST_BUILD_SHARED)
add_library(zlib_blast_blast SHARED
blast.c
blast.h)
add_library(BLAST::BLAST ALIAS zlib_blast_blast)
if(NOT CYGWIN)
set_target_properties(zlib_blast_blast
PROPERTIES
SOVERSION ${blast_VERSION_MAJOR}
VERSION ${blast_VERSION})
endif(NOT CYGWIN)
set_target_properties(zlib_blast_blast
PROPERTIES
EXPORT_NAME BLAST
OUTPUT_NAME blast)
if(ZLIB_BLAST_BUILD_TESTING)
enable_testing()
add_executable(zlib_blast_blast-test blast-test.c)
target_link_libraries(zlib_blast_blast-test PRIVATE zlib_blast_blast)
add_test(NAME zlib_blast_blast-test
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/tester.cmake
"$<TARGET_FILE:zlib_blast_blast-test>"
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}")
if(MSVC
OR MSYS
OR MINGW
OR CYGWIN)
blast_findtestenv(zlib_blast_blast-test)
endif(
MSVC
OR MSYS
OR MINGW
OR CYGWIN)
endif(ZLIB_BLAST_BUILD_TESTING)
endif(ZLIB_BLAST_BUILD_SHARED)
if(ZLIB_BLAST_BUILD_STATIC)
add_library(zlib_blast_blastStatic STATIC
blast.c
blast.h)
add_library(BLAST::BLASTSTATIC ALIAS zlib_blast_blastStatic)
set_target_properties(zlib_blast_blastStatic
PROPERTIES
EXPORT_NAME BLASTSTATIC
OUTPUT_NAME blast${zlibblast_static_suffix})
if(ZLIB_BLAST_BUILD_TESTING)
enable_testing()
add_executable(zlib_blast_testStatic blast-test.c)
target_link_libraries(zlib_blast_testStatic
PRIVATE zlib_blast_blastStatic)
add_test(NAME zlib_blast_testStatic
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/tester.cmake
"$<TARGET_FILE:zlib_blast_testStatic>"
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}")
endif(ZLIB_BLAST_BUILD_TESTING)
endif(ZLIB_BLAST_BUILD_STATIC)
if(ZLIB_BLAST_BUILD_TESTING)
add_subdirectory(test)
endif(ZLIB_BLAST_BUILD_TESTING)
if(ZLIB_BLAST_INSTALL)
if(ZLIB_BLAST_BUILD_SHARED)
install(
TARGETS zlib_blast_blast
COMPONENT Runtime
EXPORT zlibBlastSharedExport
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
install(
EXPORT zlibBlastSharedExport
FILE blast-shared.cmake
NAMESPACE BLAST::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/blast)
if(MSVC)
install(
FILES $<TARGET_PDB_FILE:zlib_blast_blast>
COMPONENT Development
DESTINATION ${CMAKE_INSTALL_BINDIR}
CONFIGURATIONS Debug OR RelWithDebInfo
OPTIONAL)
endif(MSVC)
endif(ZLIB_BLAST_BUILD_SHARED)
if(ZLIB_BLAST_BUILD_STATIC)
install(
TARGETS zlib_blast_blastStatic
COMPONENT Development
EXPORT zlibBlastStaticExport
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
install(
EXPORT zlibBlastStaticExport
FILE blast-static.cmake
NAMESPACE BLAST::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/blast)
endif(ZLIB_BLAST_BUILD_STATIC)
configure_package_config_file(
${blast_SOURCE_DIR}/blastConfig.cmake.in
${blast_BINARY_DIR}/blastConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/blast)
write_basic_package_version_file(
"${blast_BINARY_DIR}/blastConfigVersion.cmake"
VERSION "${blast_VERSION}"
COMPATIBILITY AnyNewerVersion)
install(FILES ${blast_BINARY_DIR}/blastConfig.cmake
${blast_BINARY_DIR}/blastConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/blast)
install(
FILES blast.h
COMPONENT Development
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
endif(ZLIB_BLAST_INSTALL)
+5 -11
View File
@@ -1,14 +1,8 @@
all: test
blast: blast.c blast.h
cc -DTEST -o blast blast.c
libblast.so: blast.c blast.h
cc -o libblast.so -shared blast.c
blast-test: libblast.so
cc -o blast-test.o -c blast-test.c
cc -o blast-test blast-test.o libblast.so
test: blast-test
LD_LIBRARY_PATH=./ ./blast-test < test.pk | cmp - test.txt
test: blast
blast < test.pk | cmp - test.txt
clean:
rm -f libblast.so blast-test blast-test.o
rm -f blast blast.o
-42
View File
@@ -1,42 +0,0 @@
#include "blast.h" /* prototype for blast() */
/* Example of how to use blast() */
#include <stdio.h>
#include <stdlib.h>
#define CHUNK 16384
local unsigned inf(void *how, unsigned char **buf)
{
static unsigned char hold[CHUNK];
*buf = hold;
return fread(hold, 1, CHUNK, (FILE *)how);
}
local int outf(void *how, unsigned char *buf, unsigned len)
{
return fwrite(buf, 1, len, (FILE *)how) != len;
}
/* Decompress a PKWare Compression Library stream from stdin to stdout */
int main(void)
{
int ret;
unsigned left;
/* decompress to stdout */
left = 0;
ret = blast(inf, stdin, outf, stdout, &left, NULL);
if (ret != 0)
fprintf(stderr, "blast error: %d\n", ret);
/* count any leftover bytes */
while (getchar() != EOF)
left++;
if (left)
fprintf(stderr, "blast warning: %u unused bytes of input\n", left);
/* return blast() error code */
return ret;
}
+44
View File
@@ -33,6 +33,7 @@
#include <setjmp.h> /* for setjmp(), longjmp(), and jmp_buf */
#include "blast.h" /* prototype for blast() */
#define local static /* for local function definitions */
#define MAXBITS 13 /* maximum code length */
#define MAXWIN 4096 /* maximum window size */
@@ -420,3 +421,46 @@ int blast(blast_in infun, void *inhow, blast_out outfun, void *outhow,
err = 1;
return err;
}
#ifdef TEST
/* Example of how to use blast() */
#include <stdio.h>
#include <stdlib.h>
#define CHUNK 16384
local unsigned inf(void *how, unsigned char **buf)
{
static unsigned char hold[CHUNK];
*buf = hold;
return fread(hold, 1, CHUNK, (FILE *)how);
}
local int outf(void *how, unsigned char *buf, unsigned len)
{
return fwrite(buf, 1, len, (FILE *)how) != len;
}
/* Decompress a PKWare Compression Library stream from stdin to stdout */
int main(void)
{
int ret;
unsigned left;
/* decompress to stdout */
left = 0;
ret = blast(inf, stdin, outf, stdout, &left, NULL);
if (ret != 0)
fprintf(stderr, "blast error: %d\n", ret);
/* count any leftover bytes */
while (getchar() != EOF)
left++;
if (left)
fprintf(stderr, "blast warning: %u unused bytes of input\n", left);
/* return blast() error code */
return ret;
}
#endif
-1
View File
@@ -21,7 +21,6 @@
Mark Adler madler@alumni.caltech.edu
*/
#define local static /* for local function definitions */
/*
* blast() decompresses the PKWare Data Compression Library (DCL) compressed
@@ -1,18 +0,0 @@
@PACKAGE_INIT@
set(_blast_supported_components "shared" "static")
if(blast_FIND_COMPONENTS)
foreach(_comp ${blast_FIND_COMPONENTS})
if(NOT _comp IN_LIST _blast_supported_components)
set(blast_FOUND False)
set(blast_NOT_FOUND_MESSAGE "Unsupported component: ${_comp}")
endif(NOT _comp IN_LIST _blast_supported_components)
include("${CMAKE_CURRENT_LIST_DIR}/blast-${_comp}.cmake")
endforeach(_comp ${blast_FIND_COMPONENTS})
else(blast_FIND_COMPONENTS)
foreach(_component_config IN LISTS _blast_supported_components)
include("${CMAKE_CURRENT_LIST_DIR}/blast-${_component_config}.cmake")
endforeach(_component_config IN LISTS _blast_supported_components)
endif(blast_FIND_COMPONENTS)
@@ -1,193 +0,0 @@
# if we are built from with zlib, use this path's)
if(DEFINED ZLIB_BUILD_BLAST)
set(WORK_DIR ${zlib_BINARY_DIR})
set(inst_setup zlib_install)
else(DEFINED ZLIB_BUILD_BLAST)
set(WORK_DIR ${blast_BINARY_DIR})
set(inst_setup zlib_blast_install)
set(ZLIB_ARG "-DZLIB_DIR=${ZLIB_DIR}")
add_test(
NAME zlib_blast_install
COMMAND ${CMAKE_COMMAND} --install ${blast_BINARY_DIR} --prefix
${CMAKE_CURRENT_BINARY_DIR}/test_install --config $<CONFIG>
WORKING_DIRECTORY ${blast_BINARY_DIR})
set_tests_properties(zlib_blast_install
PROPERTIES
FIXTURES_SETUP zlib_blast_install)
endif(DEFINED ZLIB_BUILD_BLAST)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/findpackage_test)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/find_package_test.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/findpackage_test/CMakeLists.txt @ONLY)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/add_subdirectory_test.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test/CMakeLists.txt @ONLY)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/add_subdirectory_exclude_test.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test/CMakeLists.txt
@ONLY)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/find_package_no_components_test.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/findpackage_no_components_test/CMakeLists.txt
@ONLY)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/find_package_wrong_components_test.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/findpackage_wrong_components_test/CMakeLists.txt
@ONLY)
# CMAKE_GENERATOR_PLATFORM doesn't work in the if
set(GENERATOR ${CMAKE_GENERATOR_PLATFORM})
if(GENERATOR)
set(PLATFORM "-A ${GENERATOR}")
endif(GENERATOR)
#
# findpackage_test
#
add_test(
NAME zlib_blast_find_package_configure
COMMAND
${CMAKE_COMMAND} ${PLATFORM}
-B${CMAKE_CURRENT_BINARY_DIR}/findpackage_test_build
-DCMAKE_BUILD_TYPE=$<CONFIG>
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG}
--fresh
-G "${CMAKE_GENERATOR}"
-S${CMAKE_CURRENT_BINARY_DIR}/findpackage_test)
add_test(
NAME zlib_blast_find_package_build
COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/findpackage_test_build)
set_tests_properties(
zlib_blast_find_package_configure
PROPERTIES
FIXTURES_REQUIRED ${inst_setup}
FIXTURES_SETUP blast_fp_config)
set_tests_properties(zlib_blast_find_package_build
PROPERTIES
FIXTURES_REQUIRED blast_fp_config)
#
# add_subdirectory_test
#
add_test(
NAME zlib_blast_add_subdirectory_configure
COMMAND
${CMAKE_COMMAND} ${PLATFORM}
-B${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test_build
-DCMAKE_BUILD_TYPE=$<CONFIG>
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG}
--fresh
-G "${CMAKE_GENERATOR}"
-S${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test)
add_test(
NAME zlib_blast_add_subdirectory_build
COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test_build)
set_tests_properties(
zlib_blast_add_subdirectory_configure
PROPERTIES
FIXTURES_REQUIRED ${inst_setup}
FIXTURES_SETUP blast_as_config)
set_tests_properties(zlib_blast_add_subdirectory_build
PROPERTIES
FIXTURES_REQUIRED blast_as_config)
#
# add_subdirectory_exclude_test
#
add_test(
NAME zlib_blast_add_subdirectory_exclude_configure
COMMAND
${CMAKE_COMMAND} ${PLATFORM}
-B${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test_build
-DCMAKE_BUILD_TYPE=$<CONFIG>
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG}
--fresh
-G "${CMAKE_GENERATOR}"
-S${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test)
add_test(
NAME zlib_blast_add_subdirectory_exclude_build
COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test_build)
set_tests_properties(zlib_blast_add_subdirectory_exclude_configure
PROPERTIES
FIXTURES_REQUIRED ${inst_setup}
FIXTURES_SETUP blast_asx_config)
set_tests_properties(zlib_blast_add_subdirectory_exclude_build
PROPERTIES
FIXTURES_REQUIRED blast_asx_config)
#
# findpackage_no_components_test
#
add_test(
NAME zlib_blast_find_package_no_components_configure
COMMAND
${CMAKE_COMMAND} ${PLATFORM}
-B${CMAKE_CURRENT_BINARY_DIR}/findpackage_no_components_test_build
-DCMAKE_BUILD_TYPE=$<CONFIG> -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG}
--fresh
-G "${CMAKE_GENERATOR}"
-S${CMAKE_CURRENT_BINARY_DIR}/findpackage_no_components_test)
set_tests_properties(
zlib_blast_find_package_no_components_configure
PROPERTIES
FIXTURES_REQUIRED ${inst_setup})
if(NOT ZLIB_BLAST_BUILD_SHARED OR NOT ZLIB_BLAST_BUILD_STATIC)
set_tests_properties(zlib_blast_find_package_no_components_configure
PROPERTIES
WILL_FAIL TRUE)
endif(NOT ZLIB_BLAST_BUILD_SHARED OR NOT ZLIB_BLAST_BUILD_STATIC)
#
# findpackage_wrong_components_test
#
add_test(
NAME zlib_blast_find_package_wrong_components_configure
COMMAND
${CMAKE_COMMAND} ${PLATFORM}
-B${CMAKE_CURRENT_BINARY_DIR}/findpackage_wrong_components_test_build
-DCMAKE_BUILD_TYPE=$<CONFIG> -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG}
--fresh
-G "${CMAKE_GENERATOR}"
-S${CMAKE_CURRENT_BINARY_DIR}/findpackage_wrong_components_test)
set_tests_properties(zlib_blast_find_package_wrong_components_configure
PROPERTIES
FIXTURES_REQUIRED ${inst_setup}
WILL_FAIL TRUE)
@@ -1,27 +0,0 @@
cmake_minimum_required(VERSION 3.12...3.31)
project(
blast_find_package
LANGUAGES C
VERSION @blast_VERSION@)
option(ZLIB_BLAST_BUILD_SHARED "" @ZLIB_BLAST_BUILD_SHARED@)
option(ZLIB_BLAST_BUILD_STATIC "" @ZLIB_BLAST_BUILD_STATIC@)
option(ZLIB_BLAST_BUILD_TESTING "" @ZLIB_BLAST_BUILD_TESTING@)
add_subdirectory(@blast_SOURCE_DIR@
${CMAKE_CURRENT_BINARY_DIR}/blast
EXCLUDE_FROM_ALL)
set(BLAST_SRCS
@blast_SOURCE_DIR@/blast-test.c)
if(ZLIB_BLAST_BUILD_SHARED)
add_executable(test_example ${BLAST_SRCS})
target_link_libraries(test_example BLAST::BLAST)
endif(ZLIB_BLAST_BUILD_SHARED)
if(ZLIB_BLAST_BUILD_STATIC)
add_executable(test_example_static ${BLAST_SRCS})
target_link_libraries(test_example_static BLAST::BLASTSTATIC)
endif(ZLIB_BLAST_BUILD_STATIC)
@@ -1,25 +0,0 @@
cmake_minimum_required(VERSION 3.12...3.31)
project(
blast_find_package
LANGUAGES C
VERSION @blast_VERSION@)
option(ZLIB_BLAST_BUILD_SHARED "" @ZLIB_BLAST_BUILD_SHARED@)
option(ZLIB_BLAST_BUILD_STATIC "" @ZLIB_BLAST_BUILD_STATIC@)
option(ZLIB_BLAST_BUILD_TESTING "" @ZLIB_BLAST_BUILD_TESTING@)
add_subdirectory(@blast_SOURCE_DIR@ ${CMAKE_CURRENT_BINARY_DIR}/blast)
set(BLAST_SRCS
@blast_SOURCE_DIR@/blast-test.c)
if(ZLIB_BLAST_BUILD_SHARED)
add_executable(test_example ${BLAST_SRCS})
target_link_libraries(test_example BLAST::BLAST)
endif(ZLIB_BLAST_BUILD_SHARED)
if(ZLIB_BLAST_BUILD_STATIC)
add_executable(test_example_static ${BLAST_SRCS})
target_link_libraries(test_example_static BLAST::BLASTSTATIC)
endif(ZLIB_BLAST_BUILD_STATIC)
@@ -1,24 +0,0 @@
cmake_minimum_required(VERSION 3.12...3.31)
project(
blast_find_package
LANGUAGES C
VERSION @blast_VERSION@)
option(ZLIB_BLAST_BUILD_SHARED "" @ZLIB_BLAST_BUILD_SHARED@)
option(ZLIB_BLAST_BUILD_STATIC "" @ZLIB_BLAST_BUILD_STATIC@)
find_package(blast REQUIRED CONFIG)
set(BLAST_SRCS
@blast_SOURCE_DIR@/blast-test.c)
if(ZLIB_BLAST_BUILD_SHARED)
add_executable(test_example ${BLAST_SRCS})
target_link_libraries(test_example BLAST::BLAST)
endif(ZLIB_BLAST_BUILD_SHARED)
if(ZLIB_BLAST_BUILD_STATIC)
add_executable(test_example_static ${BLAST_SRCS})
target_link_libraries(test_example_static BLAST::BLASTSTATIC)
endif(ZLIB_BLAST_BUILD_STATIC)
@@ -1,24 +0,0 @@
cmake_minimum_required(VERSION 3.12...3.31)
project(
blast_find_package
LANGUAGES C
VERSION @blast_VERSION@)
option(ZLIB_BLAST_BUILD_SHARED "" @ZLIB_BLAST_BUILD_SHARED@)
option(ZLIB_BLAST_BUILD_STATIC "" @ZLIB_BLAST_BUILD_STATIC@)
set(BLAST_SRCS
@blast_SOURCE_DIR@/blast-test.c)
if(ZLIB_BLAST_BUILD_SHARED)
find_package(blast REQUIRED COMPONENTS shared CONFIG)
add_executable(test_example ${BLAST_SRCS})
target_link_libraries(test_example BLAST::BLAST)
endif(ZLIB_BLAST_BUILD_SHARED)
if(ZLIB_BLAST_BUILD_STATIC)
find_package(blast REQUIRED COMPONENTS static CONFIG)
add_executable(test_example_static ${BLAST_SRCS})
target_link_libraries(test_example_static BLAST::BLASTSTATIC)
endif(ZLIB_BLAST_BUILD_STATIC)
@@ -1,24 +0,0 @@
cmake_minimum_required(VERSION 3.12...3.31)
project(
blast_find_package
LANGUAGES C
VERSION @blast_VERSION@)
option(ZLIB_BLAST_BUILD_SHARED "" @ZLIB_BLAST_BUILD_SHARED@)
option(ZLIB_BLAST_BUILD_STATIC "" @ZLIB_BLAST_BUILD_STATIC@)
find_package(blast REQUIRED COMPONENTS wrong CONFIG)
set(BLAST_SRCS
@blast_SOURCE_DIR@/blast-test.c)
if(ZLIB_BLAST_BUILD_SHARED)
add_executable(test_example ${BLAST_SRCS})
target_link_libraries(test_example BLAST::BLAST)
endif(ZLIB_BLAST_BUILD_SHARED)
if(ZLIB_BLAST_BUILD_STATIC)
add_executable(test_example_static ${BLAST_SRCS})
target_link_libraries(test_example_static BLAST::BLASTSTATIC)
endif(ZLIB_BLAST_BUILD_STATIC)
-28
View File
@@ -1,28 +0,0 @@
cmake_minimum_required(VERSION 3.12...3.31)
#CMAKE_ARGV0 = ${CMAKE_COMMAND}
#CMAKE_ARGV1 = -P
#CMAKE_ARGV2 = ${CMAKE_CURRENT_SOURCE_DIR}/tester.cmake
#CMAKE_ARGV3 = "$<TARGET_FILE:blast-test>"
#CMAKE_ARGV4 = "${CMAKE_CURRENT_SOURCE_DIR}"
#CMAKE_ARGV5 = "${CMAKE_CURRENT_BINARY_DIR}")
execute_process(COMMAND ${CMAKE_ARGV3}
INPUT_FILE "${CMAKE_ARGV4}/test.pk"
OUTPUT_FILE "${CMAKE_ARGV5}/output.txt"
RESULT_VARIABLE RESULT)
if(RESULT)
message(FATAL_ERROR "Command exitited with: ${RESULT}")
endif(RESULT)
execute_process(COMMAND ${CMAKE_ARGV0} -E compare_files
"${CMAKE_ARGV4}/test.txt"
"${CMAKE_ARGV5}/output.txt"
RESULT_VARIABLE RESULT)
file(REMOVE "${CMAKE_ARGV5}/output.txt")
if(RESULT)
message(FATAL_ERROR "Files differ")
endif(RESULT)
@@ -1,67 +0,0 @@
# check if we compile for IBM s390x
#
CHECK_C_SOURCE_COMPILES("
#ifndef __s390x__
#error
#endif
int main() {return 0;}
" HAS_S390X_SUPPORT)
#
# Check for IBM S390X - VX extensions
#
if(ZLIB_WITH_CRC32VX AND HAS_S390X_SUPPORT)
# preset the compiler specific flags
if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(VGFMAFLAG "-fzvector")
else()
set(VGFMAFLAG "-mzarch")
endif(CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(S390X_VX_TEST
"#ifndef __s390x__ \n\
#error \n\
#endif \n\
#include <vecintrin.h> \n\
int main(void) { \
unsigned long long a __attribute__((vector_size(16))) = { 0 }; \
unsigned long long b __attribute__((vector_size(16))) = { 0 }; \
unsigned char c __attribute__((vector_size(16))) = { 0 }; \
c = vec_gfmsum_accum_128(a, b, c); \
return c[0]; \
}")
# cflags already contains a valid march
set(CMAKE_REQUIRED_FLAGS "${VGFMAFLAG}")
check_c_source_compiles("${S390X_VX_TEST}" HAS_S390X_VX_SUPPORT)
unset(CMAKE_REQUIRED_FLAGS)
# or set march for our compile units
if(NOT HAS_S390X_VX_SUPPORT)
set(CMAKE_REQUIRED_FLAGS "${VGFMAFLAG} -march=z13")
check_c_source_compiles("${S390X_VX_TEST}" HAS_Z13_S390X_VX_SUPPORT)
unset(CMAKE_REQUIRED_FLAGS )
list(APPEND VGFMAFLAG "-march=z13")
endif(NOT HAS_S390X_VX_SUPPORT)
# prepare compiling for s390x
if(HAS_S390X_VX_SUPPORT OR HAS_Z13_S390X_VX_SUPPORT)
if(ZLIB_BUILD_SHARED)
target_sources(zlib
PRIVATE
crc32_vx.c
crc32_vx_hooks.h)
target_compile_definitions(zlib PUBLIC -DHAVE_S390X_VX=1)
endif(ZLIB_BUILD_SHARED)
if(ZLIB_BUILD_STATIC)
target_sources(zlibstatic
PRIVATE
crc32_vx.c
crc32_vx_hooks.h)
target_compile_definitions(zlibstatic PUBLIC -DHAVE_S390X_VX=1)
endif(ZLIB_BUILD_STATIC)
set_source_files_properties(
crc32_vx.c
PROPERTIES COMPILE_OPTIONS "${VGFMAFLAG}")
endif(HAS_S390X_VX_SUPPORT OR HAS_Z13_S390X_VX_SUPPORT)
endif(ZLIB_WITH_CRC32VX AND HAS_S390X_SUPPORT)
-9
View File
@@ -1,9 +0,0 @@
IBM Z mainframes starting from version z13 provide vector instructions, which
allows vectorization of crc32. This extension is build by default when targeting
ibm s390x. However this extension can disabled if desired:
# for configure build
$ ./configure --disable-crcvx
# for cmake build
$ cmake .. -DZLIB_CRC32VX=off
-254
View File
@@ -1,254 +0,0 @@
/*
* Hardware-accelerated CRC-32 variants for Linux on z Systems
*
* Use the z/Architecture Vector Extension Facility to accelerate the
* computing of bitreflected CRC-32 checksums.
*
* This CRC-32 implementation algorithm is bitreflected and processes
* the least-significant bit first (Little-Endian).
*
* This code was originally written by Hendrik Brueckner
* <brueckner@linux.vnet.ibm.com> for use in the Linux kernel and has been
* relicensed under the zlib license.
*/
#define Z_ONCE
#include "../../zutil.h"
#include "crc32_vx_hooks.h"
#include <stdint.h>
#include <stdio.h>
#include <vecintrin.h>
#include <sys/auxv.h>
#ifdef __clang__
# if ((__clang_major__ == 18) || (__clang_major__ == 19 && (__clang_minor__ < 1 || (__clang_minor__ == 1 && __clang_patchlevel__ < 2))))
# error crc32_vx optimizations are broken due to compiler bug in Clang versions: 18.0.0 <= clang_version < 19.1.2. \
Either disable the zlib crc32_vx optimization, or switch to another compiler/compiler version.
# endif
#endif
#define VX_MIN_LEN 64
#define VX_ALIGNMENT 16L
#define VX_ALIGN_MASK (VX_ALIGNMENT - 1)
typedef unsigned char uv16qi __attribute__((vector_size(16)));
typedef unsigned int uv4si __attribute__((vector_size(16)));
typedef unsigned long long uv2di __attribute__((vector_size(16)));
local uint32_t crc32_le_vgfm_16(uint32_t crc, const unsigned char *buf, size_t len) {
/*
* The CRC-32 constant block contains reduction constants to fold and
* process particular chunks of the input data stream in parallel.
*
* For the CRC-32 variants, the constants are precomputed according to
* these definitions:
*
* R1 = [(x4*128+32 mod P'(x) << 32)]' << 1
* R2 = [(x4*128-32 mod P'(x) << 32)]' << 1
* R3 = [(x128+32 mod P'(x) << 32)]' << 1
* R4 = [(x128-32 mod P'(x) << 32)]' << 1
* R5 = [(x64 mod P'(x) << 32)]' << 1
* R6 = [(x32 mod P'(x) << 32)]' << 1
*
* The bitreflected Barret reduction constant, u', is defined as
* the bit reversal of floor(x**64 / P(x)).
*
* where P(x) is the polynomial in the normal domain and the P'(x) is the
* polynomial in the reversed (bitreflected) domain.
*
* CRC-32 (IEEE 802.3 Ethernet, ...) polynomials:
*
* P(x) = 0x04C11DB7
* P'(x) = 0xEDB88320
*/
const uv16qi perm_le2be = {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}; /* BE->LE mask */
const uv2di r2r1 = {0x1C6E41596, 0x154442BD4}; /* R2, R1 */
const uv2di r4r3 = {0x0CCAA009E, 0x1751997D0}; /* R4, R3 */
const uv2di r5 = {0, 0x163CD6124}; /* R5 */
const uv2di ru_poly = {0, 0x1F7011641}; /* u' */
const uv2di crc_poly = {0, 0x1DB710641}; /* P'(x) << 1 */
/*
* Load the initial CRC value.
*
* The CRC value is loaded into the rightmost word of the
* vector register and is later XORed with the LSB portion
* of the loaded input data.
*/
uv2di v0 = {0, 0};
v0 = (uv2di)vec_insert(crc, (uv4si)v0, 3);
/* Load a 64-byte data chunk and XOR with CRC */
uv2di v1 = vec_perm(((uv2di *)buf)[0], ((uv2di *)buf)[0], perm_le2be);
uv2di v2 = vec_perm(((uv2di *)buf)[1], ((uv2di *)buf)[1], perm_le2be);
uv2di v3 = vec_perm(((uv2di *)buf)[2], ((uv2di *)buf)[2], perm_le2be);
uv2di v4 = vec_perm(((uv2di *)buf)[3], ((uv2di *)buf)[3], perm_le2be);
v1 ^= v0;
buf += 64;
len -= 64;
while (len >= 64) {
/* Load the next 64-byte data chunk */
uv16qi part1 = vec_perm(((uv16qi *)buf)[0], ((uv16qi *)buf)[0], perm_le2be);
uv16qi part2 = vec_perm(((uv16qi *)buf)[1], ((uv16qi *)buf)[1], perm_le2be);
uv16qi part3 = vec_perm(((uv16qi *)buf)[2], ((uv16qi *)buf)[2], perm_le2be);
uv16qi part4 = vec_perm(((uv16qi *)buf)[3], ((uv16qi *)buf)[3], perm_le2be);
/*
* Perform a GF(2) multiplication of the doublewords in V1 with
* the R1 and R2 reduction constants in V0. The intermediate result
* is then folded (accumulated) with the next data chunk in PART1 and
* stored in V1. Repeat this step for the register contents
* in V2, V3, and V4 respectively.
*/
v1 = (uv2di)vec_gfmsum_accum_128(r2r1, v1, part1);
v2 = (uv2di)vec_gfmsum_accum_128(r2r1, v2, part2);
v3 = (uv2di)vec_gfmsum_accum_128(r2r1, v3, part3);
v4 = (uv2di)vec_gfmsum_accum_128(r2r1, v4, part4);
buf += 64;
len -= 64;
}
/*
* Fold V1 to V4 into a single 128-bit value in V1. Multiply V1 with R3
* and R4 and accumulating the next 128-bit chunk until a single 128-bit
* value remains.
*/
v1 = (uv2di)vec_gfmsum_accum_128(r4r3, v1, (uv16qi)v2);
v1 = (uv2di)vec_gfmsum_accum_128(r4r3, v1, (uv16qi)v3);
v1 = (uv2di)vec_gfmsum_accum_128(r4r3, v1, (uv16qi)v4);
while (len >= 16) {
/* Load next data chunk */
v2 = vec_perm(*(uv2di *)buf, *(uv2di *)buf, perm_le2be);
/* Fold next data chunk */
v1 = (uv2di)vec_gfmsum_accum_128(r4r3, v1, (uv16qi)v2);
buf += 16;
len -= 16;
}
/*
* Set up a vector register for byte shifts. The shift value must
* be loaded in bits 1-4 in byte element 7 of a vector register.
* Shift by 8 bytes: 0x40
* Shift by 4 bytes: 0x20
*/
uv16qi v9 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
v9 = vec_insert((unsigned char)0x40, v9, 7);
/*
* Prepare V0 for the next GF(2) multiplication: shift V0 by 8 bytes
* to move R4 into the rightmost doubleword and set the leftmost
* doubleword to 0x1.
*/
v0 = vec_srb(r4r3, (uv2di)v9);
v0[0] = 1;
/*
* Compute GF(2) product of V1 and V0. The rightmost doubleword
* of V1 is multiplied with R4. The leftmost doubleword of V1 is
* multiplied by 0x1 and is then XORed with rightmost product.
* Implicitly, the intermediate leftmost product becomes padded
*/
v1 = (uv2di)vec_gfmsum_128(v0, v1);
/*
* Now do the final 32-bit fold by multiplying the rightmost word
* in V1 with R5 and XOR the result with the remaining bits in V1.
*
* To achieve this by a single VGFMAG, right shift V1 by a word
* and store the result in V2 which is then accumulated. Use the
* vector unpack instruction to load the rightmost half of the
* doubleword into the rightmost doubleword element of V1; the other
* half is loaded in the leftmost doubleword.
* The vector register with CONST_R5 contains the R5 constant in the
* rightmost doubleword and the leftmost doubleword is zero to ignore
* the leftmost product of V1.
*/
v9 = vec_insert((unsigned char)0x20, v9, 7);
v2 = vec_srb(v1, (uv2di)v9);
v1 = vec_unpackl((uv4si)v1); /* Split rightmost doubleword */
v1 = (uv2di)vec_gfmsum_accum_128(r5, v1, (uv16qi)v2);
/*
* Apply a Barret reduction to compute the final 32-bit CRC value.
*
* The input values to the Barret reduction are the degree-63 polynomial
* in V1 (R(x)), degree-32 generator polynomial, and the reduction
* constant u. The Barret reduction result is the CRC value of R(x) mod
* P(x).
*
* The Barret reduction algorithm is defined as:
*
* 1. T1(x) = floor( R(x) / x^32 ) GF2MUL u
* 2. T2(x) = floor( T1(x) / x^32 ) GF2MUL P(x)
* 3. C(x) = R(x) XOR T2(x) mod x^32
*
* Note: The leftmost doubleword of vector register containing
* CONST_RU_POLY is zero and, thus, the intermediate GF(2) product
* is zero and does not contribute to the final result.
*/
/* T1(x) = floor( R(x) / x^32 ) GF2MUL u */
v2 = vec_unpackl((uv4si)v1);
v2 = (uv2di)vec_gfmsum_128(ru_poly, v2);
/*
* Compute the GF(2) product of the CRC polynomial with T1(x) in
* V2 and XOR the intermediate result, T2(x), with the value in V1.
* The final result is stored in word element 2 of V2.
*/
v2 = vec_unpackl((uv4si)v2);
v2 = (uv2di)vec_gfmsum_accum_128(crc_poly, v2, (uv16qi)v1);
return ((uv4si)v2)[2];
}
local unsigned long s390_crc32_vx(unsigned long crc, const unsigned char FAR *buf, z_size_t len)
{
uintptr_t prealign, aligned, remaining;
if (buf == Z_NULL) return 0UL;
if (len < VX_MIN_LEN + VX_ALIGN_MASK)
return crc32_z(crc, buf, len);
if ((uintptr_t)buf & VX_ALIGN_MASK) {
prealign = VX_ALIGNMENT - ((uintptr_t)buf & VX_ALIGN_MASK);
len -= prealign;
crc = crc32_z(crc, buf, prealign);
buf += prealign;
}
aligned = len & ~VX_ALIGN_MASK;
remaining = len & VX_ALIGN_MASK;
crc = crc32_le_vgfm_16(crc ^ 0xffffffff, buf, (size_t)aligned) ^ 0xffffffff;
if (remaining)
crc = crc32_z(crc, buf + aligned, remaining);
return crc;
}
local z_once_t s390_crc32_made = Z_ONCE_INIT;
local void s390_crc32_setup() {
unsigned long hwcap = getauxval(AT_HWCAP);
if (hwcap & HWCAP_S390_VX)
crc32_z_hook = s390_crc32_vx;
else
crc32_z_hook = crc32_z;
}
local unsigned long s390_crc32_init(unsigned long crc, const unsigned char FAR *buf, z_size_t len)
{
z_once(&s390_crc32_made,s390_crc32_setup);
return crc32_z_hook(crc, buf, len);
}
ZLIB_INTERNAL unsigned long (*crc32_z_hook)(unsigned long crc, const unsigned char FAR *buf, z_size_t len) = s390_crc32_init;
@@ -1,9 +0,0 @@
#ifndef CRC32_VX_HOOKS_H
#define CRC32_VX_HOOKS_H
/**
* CRC HOOKS
*/
ZLIB_INTERNAL extern unsigned long (*crc32_z_hook)(unsigned long crc, const unsigned char FAR *buf, z_size_t len);
#endif /* CRC32_VX_HOOKS_H */
+1 -1
View File
@@ -152,7 +152,7 @@ procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer;
const OutBuf: Pointer; BufSize: Integer);
const
zlib_version = '1.3.2';
zlib_version = '1.3.1';
type
EZlibError = class(Exception);
@@ -2,7 +2,7 @@
// © Copyright Henrik Ravn 2004
//
// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
using System;
@@ -2,7 +2,7 @@
// © Copyright Henrik Ravn 2004
//
// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
using System;
@@ -2,7 +2,7 @@
// © Copyright Henrik Ravn 2004
//
// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
using System;
@@ -2,7 +2,7 @@
// © Copyright Henrik Ravn 2004
//
// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
using System;
@@ -2,7 +2,7 @@
// © Copyright Henrik Ravn 2004
//
// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
using System;
@@ -2,7 +2,7 @@
// © Copyright Henrik Ravn 2004
//
// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
using System;
@@ -2,7 +2,7 @@
// © Copyright Henrik Ravn 2004
//
// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
using System;
@@ -2,7 +2,7 @@
// © Copyright Henrik Ravn 2004
//
// Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
using System;
@@ -17,7 +17,7 @@ using NUnit.Framework;
// Unit tests for the DotZLib class library
// ----------------------------------------
//
// Use this with NUnit 2 from https://www.nunit.org
// Use this with NUnit 2 from http://www.nunit.org
//
namespace DotZLibTests
@@ -156,7 +156,7 @@ namespace DotZLibTests
public void Info_Version()
{
Info info = new Info();
Assert.AreEqual("1.3.2", Info.Version);
Assert.AreEqual("1.3.1", Info.Version);
Assert.AreEqual(32, info.SizeOfUInt);
Assert.AreEqual(32, info.SizeOfULong);
Assert.AreEqual(32, info.SizeOfPointer);
+1 -1
View File
@@ -55,4 +55,4 @@ Build instructions:
Copyright (c) Henrik Ravn 2004
Use, modification and distribution are subject to the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -1,19 +0,0 @@
enable_language(ASM)
# Need to push CMAKE_ASM_COMPILE_OBJECT to cache as otherwise it's not
# available in top-level
set(CMAKE_ASM_COMPILE_OBJECT ${CMAKE_ASM_COMPILE_OBJECT} CACHE INTERNAL "" FORCE)
if(MSVC)
#cmake 4.1 doesn't consider cl an asm compiler
cmake_policy(SET CMP0194 NEW)
endif(MSVC)
if(ZLIB_BUILD_SHARED)
target_sources(zlib PRIVATE gvmat64.S)
endif(ZLIB_BUILD_SHARED)
if(ZLIB_BUILD_STATIC)
target_sources(zlibstatic PRIVATE gvmat64.S)
endif(ZLIB_BUILD_STATIC)
File diff suppressed because it is too large Load Diff
@@ -1,19 +0,0 @@
if(ZLIB_BUILD_SHARED)
target_sources(zlib
PRIVATE
infback9.c
inftree9.c
infback9.h
inffix9.h
inftree9.h)
endif(ZLIB_BUILD_SHARED)
if(ZLIB_BUILD_STATIC)
target_sources(zlibstatic
PRIVATE
infback9.c
inftree9.c
infback9.h
inffix9.h
inftree9.h)
endif(ZLIB_BUILD_STATIC)
+12 -12
View File
@@ -293,7 +293,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc,
mode = TABLE;
break;
case 3:
strm->msg = (z_const char *)"invalid block type";
strm->msg = (char *)"invalid block type";
mode = BAD;
}
DROPBITS(2);
@@ -304,7 +304,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc,
BYTEBITS(); /* go to byte boundary */
NEEDBITS(32);
if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
strm->msg = (z_const char *)"invalid stored block lengths";
strm->msg = (char *)"invalid stored block lengths";
mode = BAD;
break;
}
@@ -341,7 +341,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc,
state->ncode = BITS(4) + 4;
DROPBITS(4);
if (state->nlen > 286) {
strm->msg = (z_const char *)"too many length symbols";
strm->msg = (char *)"too many length symbols";
mode = BAD;
break;
}
@@ -362,7 +362,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc,
ret = inflate_table9(CODES, state->lens, 19, &(state->next),
&(lenbits), state->work);
if (ret) {
strm->msg = (z_const char *)"invalid code lengths set";
strm->msg = (char *)"invalid code lengths set";
mode = BAD;
break;
}
@@ -386,7 +386,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc,
NEEDBITS(here.bits + 2);
DROPBITS(here.bits);
if (state->have == 0) {
strm->msg = (z_const char *)"invalid bit length repeat";
strm->msg = (char *)"invalid bit length repeat";
mode = BAD;
break;
}
@@ -409,7 +409,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc,
DROPBITS(7);
}
if (state->have + copy > state->nlen + state->ndist) {
strm->msg = (z_const char *)"invalid bit length repeat";
strm->msg = (char *)"invalid bit length repeat";
mode = BAD;
break;
}
@@ -423,7 +423,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc,
/* check for end-of-block code (better have one) */
if (state->lens[256] == 0) {
strm->msg = (z_const char *)"invalid code -- missing end-of-block";
strm->msg = (char *)"invalid code -- missing end-of-block";
mode = BAD;
break;
}
@@ -437,7 +437,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc,
ret = inflate_table9(LENS, state->lens, state->nlen,
&(state->next), &(lenbits), state->work);
if (ret) {
strm->msg = (z_const char *)"invalid literal/lengths set";
strm->msg = (char *)"invalid literal/lengths set";
mode = BAD;
break;
}
@@ -447,7 +447,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc,
state->ndist, &(state->next), &(distbits),
state->work);
if (ret) {
strm->msg = (z_const char *)"invalid distances set";
strm->msg = (char *)"invalid distances set";
mode = BAD;
break;
}
@@ -495,7 +495,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc,
/* invalid code */
if (here.op & 64) {
strm->msg = (z_const char *)"invalid literal/length code";
strm->msg = (char *)"invalid literal/length code";
mode = BAD;
break;
}
@@ -527,7 +527,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc,
}
DROPBITS(here.bits);
if (here.op & 64) {
strm->msg = (z_const char *)"invalid distance code";
strm->msg = (char *)"invalid distance code";
mode = BAD;
break;
}
@@ -541,7 +541,7 @@ int ZEXPORT inflateBack9(z_stream FAR *strm, in_func in, void FAR *in_desc,
DROPBITS(extra);
}
if (offset > WSIZE - (wrap ? 0: left)) {
strm->msg = (z_const char *)"invalid distance too far back";
strm->msg = (char *)"invalid distance too far back";
mode = BAD;
break;
}
+3 -3
View File
@@ -1,5 +1,5 @@
/* inftree9.c -- generate Huffman trees for efficient decoding
* Copyright (C) 1995-2026 Mark Adler
* Copyright (C) 1995-2024 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -9,7 +9,7 @@
#define MAXBITS 15
const char inflate9_copyright[] =
" inflate9 1.3.2 Copyright 1995-2026 Mark Adler ";
" inflate9 1.3.1 Copyright 1995-2024 Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -59,7 +59,7 @@ int inflate_table9(codetype type, unsigned short FAR *lens, unsigned codes,
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
133, 133, 133, 133, 144, 199, 75};
133, 133, 133, 133, 144, 203, 77};
static const unsigned short dbase[32] = { /* Distance codes 0..31 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,
+1
View File
@@ -4,6 +4,7 @@
* Christian Michelsen Research AS
* Advanced Computing
* Fantoftvegen 38, 5036 BERGEN, Norway
* http://www.cmr.no
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
@@ -1,200 +0,0 @@
cmake_minimum_required(VERSION 3.12...3.31)
project(
iostreamV3
VERSION 1.0.0
LANGUAGES CXX
DESCRIPTION "A library for using C++ IOStreams with zlib V3"
HOMEPAGE_URL "https://www.zlib.net")
option(ZLIB_IOSTREAM3_BUILD_SHARED "Enable building blast shared library" ON)
option(ZLIB_IOSTREAM3_BUILD_STATIC "Enable building blast static library" ON)
option(ZLIB_IOSTREAM3_BUILD_TESTING "Enable building tests for blast" ON)
option(ZLIB_IOSTREAM3_INSTALL "Enable installation of iostream" ON)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
if(NOT DEFINED ZLIB_BUILD_IOSTREAM3)
if(ZLIB_IOSTREAM3_BUILD_SHARED)
list(APPEND REQUIRED_COMPONENTS "shared")
endif(ZLIB_IOSTREAM3_BUILD_SHARED)
if(ZLIB_IOSTREAM3_BUILD_STATIC)
list(APPEND REQUIRED_COMPONENTS "static")
endif(ZLIB_IOSTREAM3_BUILD_STATIC)
find_package(ZLIB REQUIRED COMPONENTS ${REQUIRED_COMPONENTS} CONFIG)
endif(NOT DEFINED ZLIB_BUILD_IOSTREAM3)
if(WIN32 OR CYGWIN)
set(zlibIOStream3_static_suffix "s")
set(CMAKE_DEBUG_POSTFIX "d")
endif(WIN32 OR CYGWIN)
function(iostreamv3_findTestEnv testName)
set(testEnv "PATH=")
if(MSVC OR MINGW)
set(separator "\\\;")
else()
set(separator ":")
endif()
string(APPEND testEnv "$<TARGET_FILE_DIR:zlib_iostream3_iostreamv3>${separator}")
string(APPEND testEnv "$<TARGET_FILE_DIR:ZLIB::ZLIB>${separator}")
string(APPEND testEnv "$ENV{PATH}")
set_tests_properties(${testName} PROPERTIES ENVIRONMENT "${testEnv}")
endfunction(iostreamv3_findTestEnv testName)
if(ZLIB_IOSTREAM3_BUILD_SHARED)
add_library(zlib_iostream3_iostreamv3 SHARED
zfstream.cc
zfstream.h)
add_library(IOSTREAMV3::IOSTREAMV3 ALIAS zlib_iostream3_iostreamv3)
if(NOT CYGWIN)
set_target_properties(zlib_iostream3_iostreamv3
PROPERTIES
SOVERSION ${iostreamV3_VERSION_MAJOR}
VERSION ${iostreamV3_VERSION})
endif(NOT CYGWIN)
set_target_properties(zlib_iostream3_iostreamv3
PROPERTIES
EXPORT_NAME IOSTREAMV3
OUTPUT_NAME iostream3)
target_link_libraries(zlib_iostream3_iostreamv3
PUBLIC ZLIB::ZLIB)
if(ZLIB_IOSTREAM3_BUILD_TESTING)
enable_testing()
add_executable(zlib_iostream3_test test.cc zfstream.h)
target_link_libraries(zlib_iostream3_test
PRIVATE zlib_iostream3_iostreamv3)
add_test(NAME zlib_iostream3_test COMMAND zlib_iostream3_test)
set_tests_properties(zlib_iostream3_test
PROPERTIES
FIXTURES_REQUIRED zlib_iostream3_cleanup)
if(MSVC
OR MSYS
OR MINGW
OR CYGWIN)
iostreamv3_findtestenv(zlib_iostream3_test)
endif(
MSVC
OR MSYS
OR MINGW
OR CYGWIN)
endif(ZLIB_IOSTREAM3_BUILD_TESTING)
endif(ZLIB_IOSTREAM3_BUILD_SHARED)
if(ZLIB_IOSTREAM3_BUILD_STATIC)
add_library(zlib_iostream3_iostreamv3Static STATIC
zfstream.cc
zfstream.h)
add_library(IOSTREAMV3::IOSTREAMV3STATIC
ALIAS zlib_iostream3_iostreamv3Static)
target_link_libraries(zlib_iostream3_iostreamv3Static
PUBLIC ZLIB::ZLIBSTATIC)
set_target_properties(zlib_iostream3_iostreamv3Static
PROPERTIES
EXPORT_NAME IOSTREAMV3STATIC
OUTPUT_NAME iostream3${zlib_IOStream3_static_suffix})
if(ZLIB_IOSTREAM3_BUILD_TESTING)
enable_testing()
add_executable(zlib_iostream3_testStatic test.cc zfstream.h)
target_link_libraries(zlib_iostream3_testStatic
PRIVATE zlib_iostream3_iostreamv3Static)
add_test(NAME zlib_iostream3_testStatic
COMMAND zlib_iostream3_testStatic)
set_tests_properties(zlib_iostream3_testStatic
PROPERTIES
FIXTURES_REQUIRED zlib_iostream3_cleanup)
endif(ZLIB_IOSTREAM3_BUILD_TESTING)
endif(ZLIB_IOSTREAM3_BUILD_STATIC)
if(ZLIB_IOSTREAM3_BUILD_TESTING)
add_test(NAME zlib_iostream3_cleanup COMMAND ${CMAKE_COMMAND} -E rm
${CMAKE_CURRENT_BINARY_DIR}/test1.txt.gz
${CMAKE_CURRENT_BINARY_DIR}/test2.txt.gz)
set_tests_properties(zlib_iostream3_cleanup
PROPERTIES
FIXTURES_CLEANUP zlib_iostream3_cleanup)
add_subdirectory(test)
endif(ZLIB_IOSTREAM3_BUILD_TESTING)
if(ZLIB_IOSTREAM3_INSTALL)
if(ZLIB_IOSTREAM3_BUILD_SHARED)
install(
TARGETS zlib_iostream3_iostreamv3
COMPONENT Runtime
EXPORT zlibiostream3SharedExport
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
install(
EXPORT zlibiostream3SharedExport
FILE iostreamv3-shared.cmake
NAMESPACE IOSTREAMV3::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/iostreamv3)
if(MSVC)
install(
FILES $<TARGET_PDB_FILE:zlib_iostream3_iostreamv3>
COMPONENT Development
DESTINATION ${CMAKE_INSTALL_BINDIR}
CONFIGURATIONS Debug OR RelWithDebInfo
OPTIONAL)
endif(MSVC)
endif(ZLIB_IOSTREAM3_BUILD_SHARED)
if(ZLIB_IOSTREAM3_BUILD_STATIC)
install(
TARGETS zlib_iostream3_iostreamv3Static
COMPONENT Development
EXPORT iostream3StaticExport
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
install(
EXPORT iostream3StaticExport
FILE iostreamv3-static.cmake
NAMESPACE IOSTREAMV3::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/iostreamv3)
endif(ZLIB_IOSTREAM3_BUILD_STATIC)
configure_package_config_file(
${iostreamV3_SOURCE_DIR}/iostream3Config.cmake.in
${iostreamV3_BINARY_DIR}/iostreamv3Config.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/iostreamv3)
write_basic_package_version_file(
"${iostreamV3_BINARY_DIR}/iostreamv3ConfigVersion.cmake"
VERSION "${iostream3_VERSION}"
COMPATIBILITY AnyNewerVersion)
install(FILES ${iostreamV3_BINARY_DIR}/iostreamv3Config.cmake
${iostreamV3_BINARY_DIR}/iostreamv3ConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/iostreamv3)
install(
FILES zfstream.h
COMPONENT Development
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
endif(ZLIB_IOSTREAM3_INSTALL)
@@ -1,23 +0,0 @@
@PACKAGE_INIT@
set(_iostreamv3_supported_components "shared" "static")
include(CMakeFindDependencyMacro)
if(iostreamv3_FIND_COMPONENTS)
find_dependency(ZLIB CONFIG COMPONENTS ${iostreamv3_FIND_COMPONENTS})
foreach(_comp ${iostreamv3_FIND_COMPONENTS})
if(NOT _comp IN_LIST _iostreamv3_supported_components)
set(iostreamv3_FOUND False)
set(iostreamv3_NOT_FOUND_MESSAGE "Unsupported component: ${_comp}")
endif(NOT _comp IN_LIST _iostreamv3_supported_components)
include("${CMAKE_CURRENT_LIST_DIR}/iostreamv3-${_comp}.cmake")
endforeach(_comp ${iostreamv3_FIND_COMPONENTS})
else(iostream3_FIND_COMPONENTS)
find_dependency(ZLIB CONFIG)
foreach(_component_config IN LISTS _iostreamv3_supported_components)
include("${CMAKE_CURRENT_LIST_DIR}/iostreamv3-${_component_config}.cmake")
endforeach(_component_config IN LISTS _iostreamv3_supported_components)
endif(iostreamv3_FIND_COMPONENTS)
@@ -1,191 +0,0 @@
# if we are built from with zlib, use this path's)
if(DEFINED ZLIB_BUILD_IOSTREAM3)
set(WORK_DIR ${zlib_BINARY_DIR})
set(inst_setup zlib_install)
else(DEFINED ZLIB_BUILD_IOSTREAM3)
set(WORK_DIR ${iostreamV3_BINARY_DIR})
set(inst_setup zlib_iostream3_install)
set(ZLIB_ARG "-DZLIB_DIR=${ZLIB_DIR}")
add_test(
NAME zlib_iostream3_install
COMMAND ${CMAKE_COMMAND} --install ${iostreamV3_BINARY_DIR} --prefix
${CMAKE_CURRENT_BINARY_DIR}/test_install --config $<CONFIG>
WORKING_DIRECTORY ${iostreamV3_BINARY_DIR})
set_tests_properties(zlib_iostream3_install
PROPERTIES
FIXTURES_SETUP zlib_iostream3_install)
endif(DEFINED ZLIB_BUILD_IOSTREAM3)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/findpackage_test)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/find_package_test.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/findpackage_test/CMakeLists.txt @ONLY)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/add_subdirectory_test.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test/CMakeLists.txt @ONLY)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/add_subdirectory_exclude_test.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test/CMakeLists.txt
@ONLY)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/find_package_no_components_test.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/findpackage_no_components_test/CMakeLists.txt
@ONLY)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/find_package_wrong_components_test.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/findpackage_wrong_components_test/CMakeLists.txt
@ONLY)
# CMAKE_GENERATOR_PLATFORM doesn't work in the if
set(GENERATOR ${CMAKE_GENERATOR_PLATFORM})
if(GENERATOR)
set(PLATFORM "-A ${GENERATOR}")
endif(GENERATOR)
#
# findpackage_test
#
add_test(
NAME zlib_iostream3_find_package_configure
COMMAND
${CMAKE_COMMAND}
${PLATFORM}
-B${CMAKE_CURRENT_BINARY_DIR}/findpackage_test_build
-DCMAKE_BUILD_TYPE=$<CONFIG>
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG}
--fresh
-G "${CMAKE_GENERATOR}"
-S${CMAKE_CURRENT_BINARY_DIR}/findpackage_test)
add_test(
NAME zlib_iostream3_find_package_build
COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/findpackage_test_build)
set_tests_properties(zlib_iostream3_find_package_configure
PROPERTIES
FIXTURES_REQUIRED ${inst_setup}
FIXTURES_SETUP iostream3_fp_config)
set_tests_properties(zlib_iostream3_find_package_build
PROPERTIES
FIXTURES_REQUIRED iostream3_fp_config)
#
# add_subdirectory_test
#
add_test(
NAME zlib_iostream3_add_subdirectory_configure
COMMAND
${CMAKE_COMMAND}
${PLATFORM}
-B${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test_build
-DCMAKE_BUILD_TYPE=$<CONFIG>
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install
${ZLIB_ARG}
--fresh
-G "${CMAKE_GENERATOR}"
-S${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test)
add_test(
NAME zlib_iostream3_add_subdirectory_build
COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_test_build)
set_tests_properties(zlib_iostream3_add_subdirectory_configure
PROPERTIES
FIXTURES_REQUIRED ${inst_setup}
FIXTURES_SETUP iostream3as_config)
set_tests_properties(zlib_iostream3_add_subdirectory_build
PROPERTIES
FIXTURES_REQUIRED iostream3_as_config)
#
# add_subdirectory_exclude_test
#
add_test(
NAME zlib_iostream3_add_subdirectory_exclude_configure
COMMAND
${CMAKE_COMMAND} ${PLATFORM}
-B${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test_build
-DCMAKE_BUILD_TYPE=$<CONFIG> -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG}
--fresh
-G "${CMAKE_GENERATOR}"
-S${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test)
add_test(
NAME zlib_iostream3_add_subdirectory_exclude_build
COMMAND ${CMAKE_COMMAND} --build . --config $<CONFIG>
WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_exclude_test_build)
set_tests_properties(zlib_iostream3_add_subdirectory_exclude_configure
PROPERTIES
FIXTURES_REQUIRED ${inst_setup}
FIXTURES_SETUP iostream3_asx_config)
set_tests_properties(zlib_iostream3_add_subdirectory_exclude_build
PROPERTIES
FIXTURES_REQUIRED iostream3_asx_config)
#
# findpackage_no_components_test
#
add_test(
NAME zlib_iostream3_find_package_no_components_configure
COMMAND
${CMAKE_COMMAND} ${PLATFORM}
-B${CMAKE_CURRENT_BINARY_DIR}/findpackage_no_components_test_build
-DCMAKE_BUILD_TYPE=$<CONFIG> -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG}
--fresh
-G "${CMAKE_GENERATOR}"
-S${CMAKE_CURRENT_BINARY_DIR}/findpackage_no_components_test)
set_tests_properties(zlib_iostream3_find_package_no_components_configure
PROPERTIES
FIXTURES_REQUIRED ${inst_setup})
if(NOT ZLIB_IOSTREAM3_BUILD_SHARED OR NOT ZLIB_IOSTREAM3_BUILD_STATIC)
set_tests_properties(zlib_iostream3_find_package_no_components_configure
PROPERTIES
WILL_FAIL TRUE)
endif(NOT ZLIB_IOSTREAM3_BUILD_SHARED OR NOT ZLIB_IOSTREAM3_BUILD_STATIC)
#
# findpackage_no_components_test
#
add_test(
NAME zlib_iostream3_find_package_wrong_components_configure
COMMAND
${CMAKE_COMMAND} ${PLATFORM}
-B${CMAKE_CURRENT_BINARY_DIR}/findpackage_wrong_components_test_build
-DCMAKE_BUILD_TYPE=$<CONFIG> -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_PREFIX=${WORK_DIR}/test/test_install ${ZLIB_ARG}
--fresh
-G "${CMAKE_GENERATOR}"
-S${CMAKE_CURRENT_BINARY_DIR}/findpackage_wrong_components_test)
set_tests_properties(zlib_iostream3_find_package_wrong_components_configure
PROPERTIES
FIXTURES_REQUIRED ${inst_setup}
WILL_FAIL TRUE)
@@ -1,27 +0,0 @@
cmake_minimum_required(VERSION 3.12...3.31)
project(
iostream_add_subdirectory_exclude
LANGUAGES CXX
VERSION @iostreamV3_VERSION@)
option(ZLIB_IOSTREAM3_BUILD_SHARED "" @ZLIB_IOSTREAM3_BUILD_SHARED@)
option(ZLIB_IOSTREAM3_BUILD_STATIC "" @ZLIB_IOSTREAM3_BUILD_STATIC@)
option(ZLIB_IOSTREAM3_BUILD_TESTING "" OFF)
add_subdirectory(@iostreamV3_SOURCE_DIR@
${CMAKE_CURRENT_BINARY_DIR}/iostream3
EXCLUDE_FROM_ALL)
set(IOSTREAM_SRCS
@iostreamV3_SOURCE_DIR@/test.cc)
if(ZLIB_IOSTREAM3_BUILD_SHARED)
add_executable(test_example ${IOSTREAM_SRCS})
target_link_libraries(test_example IOSTREAMV3::IOSTREAMV3)
endif(ZLIB_IOSTREAM3_BUILD_SHARED)
if(ZLIB_IOSTREAM3_BUILD_STATIC)
add_executable(test_example_static ${IOSTREAM_SRCS})
target_link_libraries(test_example_static IOSTREAMV3::IOSTREAMV3STATIC)
endif(ZLIB_IOSTREAM3_BUILD_STATIC)
@@ -1,25 +0,0 @@
cmake_minimum_required(VERSION 3.12...3.31)
project(
iostream_add_subdirectory
LANGUAGES CXX
VERSION @iostreamV3_VERSION@)
option(ZLIB_IOSTREAM3_BUILD_SHARED "" @ZLIB_IOSTREAM3_BUILD_SHARED@)
option(ZLIB_IOSTREAM3_BUILD_STATIC "" @ZLIB_IOSTREAM3_BUILD_STATIC@)
option(ZLIB_IOSTREAM3_BUILD_TESTING "" OFF)
add_subdirectory(@iostreamV3_SOURCE_DIR@ ${CMAKE_CURRENT_BINARY_DIR}/iostream3)
set(IOSTREAM_SRCS
@iostreamV3_SOURCE_DIR@/test.cc)
if(ZLIB_IOSTREAM3_BUILD_SHARED)
add_executable(test_example ${IOSTREAM_SRCS})
target_link_libraries(test_example IOSTREAMV3::IOSTREAMV3)
endif(ZLIB_IOSTREAM3_BUILD_SHARED)
if(ZLIB_IOSTREAM3_BUILD_STATIC)
add_executable(test_example_static ${IOSTREAM_SRCS})
target_link_libraries(test_example_static IOSTREAMV3::IOSTREAMV3STATIC)
endif(ZLIB_IOSTREAM3_BUILD_STATIC)
@@ -1,24 +0,0 @@
cmake_minimum_required(VERSION 3.12...3.31)
project(
iostream_find_package_no_components
LANGUAGES CXX
VERSION @iostreamV3_VERSION@)
option(ZLIB_IOSTREAM3_BUILD_SHARED "" @ZLIB_IOSTREAM3_BUILD_SHARED@)
option(ZLIB_IOSTREAM3_BUILD_STATIC "" @ZLIB_IOSTREAM3_BUILD_STATIC@)
find_package(iostreamv3 REQUIRED CONFIG)
set(IOSTREAM_SRCS
@iostreamV3_SOURCE_DIR@/test.cc)
if(ZLIB_IOSTREAM3_BUILD_SHARED)
add_executable(test_example ${IOSTREAM_SRCS})
target_link_libraries(test_example IOSTREAMV3::IOSTREAMV3)
endif(ZLIB_IOSTREAM3_BUILD_SHARED)
if(ZLIB_IOSTREAM3_BUILD_STATIC)
add_executable(test_example_static ${IOSTREAM_SRCS})
target_link_libraries(test_example_static IOSTREAMV3::IOSTREAMV3STATIC)
endif(ZLIB_IOSTREAM3_BUILD_STATIC)
@@ -1,24 +0,0 @@
cmake_minimum_required(VERSION 3.12...3.31)
project(
iostream_find_package
LANGUAGES CXX
VERSION @iostreamV3_VERSION@)
option(ZLIB_IOSTREAM_BUILD_SHARED "" @ZLIB_IOSTREAM_BUILD_SHARED@)
option(ZLIB_IOSTREAM_BUILD_STATIC "" @ZLIB_IOSTREAM_BUILD_STATIC@)
set(IOSTREAM_SRCS
@iostreamV3_SOURCE_DIR@/test.cc)
if(ZLIB_IOSTREAM_BUILD_SHARED)
find_package(iostreamv3 REQUIRED COMPONENTS shared CONFIG)
add_executable(test_example ${IOSTREAM_SRCS})
target_link_libraries(test_example IOSTREAMV3::IOSTREAMV3)
endif(ZLIB_IOSTREAM_BUILD_SHARED)
if(ZLIB_IOSTREAM_BUILD_STATIC)
find_package(iostreamv3 REQUIRED COMPONENTS static CONFIG)
add_executable(test_example_static ${IOSTREAM_SRCS})
target_link_libraries(test_example_static IOSTREAMV3::IOSTREAMV3STATIC)
endif(ZLIB_IOSTREAM_BUILD_STATIC)
@@ -1,24 +0,0 @@
cmake_minimum_required(VERSION 3.12...3.31)
project(
iostream_find_package
LANGUAGES CXX
VERSION @iostreamV3_VERSION@)
option(ZLIB_IOSTREAM_BUILD_SHARED "" @ZLIB_IOSTREAM_BUILD_SHARED@)
option(ZLIB_IOSTREAM_BUILD_STATIC "" @ZLIB_IOSTREAM_BUILD_STATIC@)
find_package(iostreamv3 REQUIRED COMPONENTS wrongCONFIG)
set(IOSTREAM_SRCS
@iostreamV3_SOURCE_DIR@/test.cc)
if(ZLIB_IOSTREAM_BUILD_SHARED)
add_executable(test_example ${IOSTREAM_SRCS})
target_link_libraries(test_example IOSTREAMV3::IOSTREAMV3)
endif(ZLIB_IOSTREAM_BUILD_SHARED)
if(ZLIB_IOSTREAM_BUILD_STATIC)
add_executable(test_example_static ${PUFF_SRCS})
target_link_libraries(test_example_static IOSTREAMV3::IOSTREAMV3STATIC)
endif(ZLIB_IOSTREAM_BUILD_STATIC)
-387
View File
@@ -1,387 +0,0 @@
cmake_minimum_required(VERSION 3.12...3.31)
project(
minizip
VERSION 1.0.0
LANGUAGES C
DESCRIPTION "A library for creating zipfiles based in zlib"
HOMEPAGE_URL "https://www.winimage.com/zLibDll/minizip.html")
if(CMAKE_SIZEOF_VOID_P LESS 8 AND NOT MINGW)
message(WARNING "libminizip needs 64bit - stopping here")
return()
endif(CMAKE_SIZEOF_VOID_P LESS 8 AND NOT MINGW)
# ============================================================================
# CPack
# ============================================================================
set(CPACK_PACKAGE_VENDOR "zlib-Project")
set(CPACK_PACKAGE_DESCRIPTION_FILE ${minizip_SOURCE_DIR}/MiniZip64_info.txt)
set(CPACK_RESOURCE_FILE_LICENSE ${minizip_SOURCE_DIR}/../../LICENSE)
set(CPACK_RESOURCE_FILE_README ${minizip_SOURCE_DIR}/MiniZip64_info.txt)
# ============================================================================
# set options if build from zlib
# ============================================================================
if(ZLIB_BUILD_MINIZIP)
set(MINIZIP_BUILD_SHARED ${ZLIB_MINIZIP_BUILD_SHARED} CACHE BOOL "")
set(MINIZIP_BUILD_STATIC ${ZLIB_MINIZIP_BUILD_STATIC} CACHE BOOL "")
set(MINIZIP_BUILD_TESTING ${ZLIB_MINIZIP_INSTALL} CACHE BOOL "")
set(MINIZIP_INSTALL ${ZLIB_MINIZIP_INSTALL} CACHE BOOL "")
endif(ZLIB_BUILD_MINIZIP)
# ============================================================================
# configuration
# ============================================================================
option(MINIZIP_BUILD_SHARED "Enable building minizip shared library" ON)
option(MINIZIP_BUILD_STATIC "Enable building minizip static library" ON)
option(MINIZIP_BUILD_TESTING "Enable testing of minizip" ON)
option(MINIZIP_ENABLE_BZIP2 "Build minizip with bzip2 support" OFF)
option(MINIZIP_INSTALL "Enable installation of minizip" ON)
include(CheckCSourceCompiles)
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CMakePackageConfigHelpers)
include(CheckTypeSize)
include(GNUInstallDirs)
if(NOT CPACK_INCLUDED)
include(CPack)
endif(NOT CPACK_INCLUDED)
if(NOT DEFINED ZLIB_BUILD_MINIZIP)
if(MINIZIP_BUILD_SHARED)
list(APPEND REQUIRED_COMPONENTS "shared")
endif(MINIZIP_BUILD_SHARED)
if(MINIZIP_BUILD_STATIC)
list(APPEND REQUIRED_COMPONENTS "static")
endif(MINIZIP_BUILD_STATIC)
find_package(ZLIB REQUIRED COMPONENTS ${REQUIRED_COMPONENTS} CONFIG)
endif(NOT DEFINED ZLIB_BUILD_MINIZIP)
if(MINIZIP_ENABLE_BZIP2)
find_package(BZip2 REQUIRED)
endif(MINIZIP_ENABLE_BZIP2)
#
# Check for fopen64
#
check_function_exists(fopen64 HAVE_FOPEN64)
#
# Check for fseeko
#
check_function_exists(fseeko HAVE_FSEEKO)
#
# Check for unistd.h
#
check_include_file(unistd.h HAVE_UNISTD_H)
#
# Check to see if we have large file support
#
set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
check_type_size(off64_t OFF64_T)
unset(CMAKE_REQUIRED_DEFINITIONS) # clear variable
#
# Check visibility attribute is supported
#
if(MSVC)
set(CMAKE_REQUIRED_FLAGS "-WX")
else(MSVC)
set(CMAKE_REQUIRED_FLAGS "-WError")
endif(MSVC)
check_c_source_compiles(
"
#include <stdlib.h>
static void f(void) __attribute__ ((visibility(\"hidden\")));
int main(void) {return 0;}
"
HAVE___ATTR__VIS_HIDDEN)
unset(CMAKE_REQUIRED_FLAGS)
set(LIBMINIZIP_SRCS ioapi.c mztools.c unzip.c zip.c)
set(LIBMINIZIP_HDRS crypt.h ints.h ioapi.h mztools.h unzip.h zip.h)
set(MINIZIP_SRCS ioapi.c $<$<BOOL:${WIN32}>:iowin32.c> minizip.c zip.c)
set(MINIZIP_HDRS crypt.h ints.h ioapi.h $<$<BOOL:${WIN32}>:iowin32.h> skipset.h
zip.h)
set(MINIUNZIP_SRCS ioapi.c $<$<BOOL:${WIN32}>:iowin32.c> miniunz.c unzip.c
zip.c)
set(MINIUNZIP_HDRS
crypt.h
ints.h
ioapi.h
$<$<BOOL:${WIN32}>:iowin32.h>
skipset.h
unzip.h
zip.h)
if(WIN32 OR CYGWIN)
set(minizip_static_suffix "s")
set(CMAKE_DEBUG_POSTFIX "d")
endif(WIN32 OR CYGWIN)
if(MINIZIP_BUILD_SHARED)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
add_library(libminizip SHARED ${LIBMINIZIP_SRCS} ${LIBMINIZIP_HDRS})
add_library(MINIZIP::minizip ALIAS libminizip)
target_include_directories(
libminizip PUBLIC $<BUILD_INTERFACE:${minizip_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_compile_definitions(
libminizip
PRIVATE $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>
$<$<BOOL:${HAVE_UNISTD_H}>:HAVE_UNISTD_H=1>
PUBLIC $<$<BOOL:${HAVE_OFF64_T}>:_LARGEFILE64_SOURCE=1>
$<$<BOOL:${BZIP2_FOUND}>:HAVE_BZIP2=1>
$<$<BOOL:NOT:${HAVE_FOPEN64}>:USE_FILE32API=1>)
if(NOT CYGWIN)
set_target_properties(libminizip PROPERTIES SOVERSION
${minizip_VERSION_MAJOR})
endif(NOT CYGWIN)
set_target_properties(
libminizip
PROPERTIES EXPORT_NAME minizip
OUTPUT_NAME minizip
VERSION ${minizip_VERSION}
SOVERSION ${minizip_VERSION_MAJOR})
target_link_libraries(libminizip
PUBLIC ZLIB::ZLIB
$<$<BOOL:${BZIP2_FOUND}>:BZip2::BZip2>)
add_executable(minizip ${MINIZIP_SRCS} ${MINIZIP_HDRS})
set_target_properties(minizip PROPERTIES EXPORT_NAME minizip_executable)
target_compile_definitions(
minizip PRIVATE $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>)
target_link_libraries(minizip PRIVATE MINIZIP::minizip)
add_executable(miniunzip ${MINIUNZIP_SRCS} ${MINIUNZIP_HDRS})
set_target_properties(miniunzip PROPERTIES EXPORT_NAME miniunzip_executable)
target_compile_definitions(
miniunzip PRIVATE $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>)
target_link_libraries(miniunzip PRIVATE MINIZIP::minizip)
endif(MINIZIP_BUILD_SHARED)
if(MINIZIP_BUILD_STATIC)
add_library(libminizipstatic STATIC ${LIBMINIZIP_SRCS} ${LIBMINIZIP_HDRS})
add_library(MINIZIP::minizipstatic ALIAS libminizipstatic)
target_include_directories(
libminizipstatic
PUBLIC $<BUILD_INTERFACE:${minizip_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_compile_definitions(
libminizipstatic
PRIVATE $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>
$<$<BOOL:${HAVE_UNISTD_H}>:HAVE_UNISTD_H=1>
PUBLIC $<$<BOOL:${HAVE_OFF64_T}>:_LARGEFILE64_SOURCE=1>
$<$<BOOL:${BZIP2_FOUND}>:HAVE_BZIP2=1>
$<$<BOOL:NOT:${HAVE_FOPEN64}>:USE_FILE32API=1>)
set_target_properties(
libminizipstatic PROPERTIES EXPORT_NAME minizipstatic
OUTPUT_NAME minizip${minizip_static_suffix})
if(CYGWIN)
set_target_properties(libminizipstatic PROPERTIES SUFFIX ".dll.a")
endif(CYGWIN)
target_link_libraries(libminizipstatic PUBLIC ZLIB::ZLIBSTATIC
$<$<BOOL:${BZIP2_FOUND}>:BZip2::BZip2>)
add_executable(minizipstatic ${MINIZIP_SRCS} ${MINIZIP_HDRS})
set_target_properties(minizipstatic PROPERTIES EXPORT_NAME
minizip_static_executable)
target_compile_definitions(
minizipstatic PRIVATE $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>)
target_link_libraries(minizipstatic PRIVATE MINIZIP::minizipstatic)
add_executable(miniunzipstatic ${MINIUNZIP_SRCS} ${MINIUNZIP_HDRS})
set_target_properties(miniunzipstatic
PROPERTIES EXPORT_NAME miniunzip_static_executable)
target_compile_definitions(
miniunzipstatic PRIVATE $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_WARNINGS>)
target_link_libraries(miniunzipstatic PRIVATE MINIZIP::minizipstatic)
endif(MINIZIP_BUILD_STATIC)
if(MINIZIP_INSTALL)
if(MINIZIP_BUILD_SHARED)
install(
TARGETS libminizip minizip miniunzip
COMPONENT Runtime
EXPORT minizipSharedExport
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
install(
EXPORT minizipSharedExport
FILE minizip-shared.cmake
NAMESPACE MINIZIP::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/minizip)
if(MSVC)
install(
FILES $<TARGET_PDB_FILE:libminizip>
COMPONENT Runtime
DESTINATION ${CMAKE_INSTALL_BINDIR}
CONFIGURATIONS Debug OR RelWithDebInfo
OPTIONAL)
endif(MSVC)
endif(MINIZIP_BUILD_SHARED)
if(MINIZIP_BUILD_STATIC)
install(
TARGETS libminizipstatic
COMPONENT Development
TARGETS minizipstatic miniunzipstatic
COMPONENT Runtime
EXPORT minizipStaticExport
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
install(
EXPORT minizipStaticExport
FILE minizip-static.cmake
NAMESPACE MINIZIP::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/minizip)
endif(MINIZIP_BUILD_STATIC)
configure_package_config_file(
${minizip_SOURCE_DIR}/minizipConfig.cmake.in
${minizip_BINARY_DIR}/minizipConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/minizip)
write_basic_package_version_file(
"${minizip_BINARY_DIR}/minizipConfigVersion.cmake"
VERSION "${minizip_VERSION}"
COMPATIBILITY AnyNewerVersion)
install(FILES ${minizip_BINARY_DIR}/minizipConfig.cmake
${minizip_BINARY_DIR}/minizipConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/minizip)
install(
FILES ${LIBMINIZIP_HDRS}
COMPONENT Development
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
endif(MINIZIP_INSTALL)
if(MINIZIP_BUILD_TESTING)
enable_testing()
if(MINIZIP_BUILD_SHARED AND NOT ${CMAKE_SHARED_LIBRARY_SUFFIX} STREQUAL
".dll")
add_test(
NAME minizip_prepare_shared_zip
COMMAND ${CMAKE_COMMAND} -DCREATE_SHARED=ON -P
${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
add_test(
NAME minizip_zipping_test_file_shared
COMMAND minizip test_file_shared.zip test_file_shared.txt
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
add_test(
NAME minizip_prepare_shared_unzip
COMMAND ${CMAKE_COMMAND} -DMOVE_SHARED=ON -P
${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
add_test(
NAME minizip_miniunzipping_test_file_shared.zip
COMMAND miniunzip test_file_shared.zip
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
add_test(
NAME minizip_compare_shared
COMMAND ${CMAKE_COMMAND} -E compare_files test_file_shared.txt
test_file_shared.orig
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
add_test(
NAME minizip_clean_shared_zip
COMMAND ${CMAKE_COMMAND} -DDELETE_SHARED=ON -P
${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
set_tests_properties(minizip_prepare_shared_zip
PROPERTIES FIXTURES_SETUP prepare_shared)
set_tests_properties(
minizip_zipping_test_file_shared
PROPERTIES FIXTURES_REQUIRED prepare_shared FIXTURES_SETUP
zip_shared)
set_tests_properties(
minizip_prepare_shared_unzip
PROPERTIES FIXTURES_REQUIRED zip_shared FIXTURES_SETUP
prepare_unzip_shared)
set_tests_properties(
minizip_miniunzipping_test_file_shared.zip
PROPERTIES FIXTURES_REQUIRED prepare_unzip_shared FIXTURES_SETUP
prepare_compare_shared)
set_tests_properties(
minizip_compare_shared
PROPERTIES FIXTURES_REQUIRED prepare_compare_shared FIXTURES_SETUP
compared_shared)
set_tests_properties(minizip_clean_shared_zip
PROPERTIES FIXTURES_CLEANUP compared_shared)
endif(MINIZIP_BUILD_SHARED AND NOT ${CMAKE_SHARED_LIBRARY_SUFFIX} STREQUAL
".dll")
if(MINIZIP_BUILD_STATIC)
add_test(
NAME minizip_prepare_static_zip
COMMAND ${CMAKE_COMMAND} -DCREATE_STATIC=ON -P
${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
add_test(
NAME minizip_zipping_test_file_static
COMMAND minizipstatic test_file_static.zip test_file_static.txt
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
add_test(
NAME minizip_prepare_static_unzip
COMMAND ${CMAKE_COMMAND} -DMOVE_STATIC=ON -P
${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
add_test(
NAME minizip_miniunzipping_test_file_static.zip
COMMAND miniunzipstatic test_file_static.zip
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
add_test(
NAME minizip_compare_static
COMMAND ${CMAKE_COMMAND} -E compare_files test_file_static.txt
test_file_static.orig
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
add_test(
NAME minizip_clean_static_zip
COMMAND ${CMAKE_COMMAND} -DDELETE_STATIC=ON -P
${CMAKE_CURRENT_SOURCE_DIR}/test/test_helper.cm
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test)
set_tests_properties(minizip_prepare_static_zip
PROPERTIES FIXTURES_SETUP prepare_static)
set_tests_properties(
minizip_zipping_test_file_static
PROPERTIES FIXTURES_REQUIRED prepare_static FIXTURES_SETUP
zip_static)
set_tests_properties(
minizip_prepare_static_unzip
PROPERTIES FIXTURES_REQUIRED zip_static FIXTURES_SETUP
prepare_unzip_static)
set_tests_properties(
minizip_miniunzipping_test_file_static.zip
PROPERTIES FIXTURES_REQUIRED prepare_unzip_static FIXTURES_SETUP
prepare_compare_static)
set_tests_properties(
minizip_compare_static
PROPERTIES FIXTURES_REQUIRED prepare_compare_static FIXTURES_SETUP
compared_static)
set_tests_properties(minizip_clean_static_zip
PROPERTIES FIXTURES_CLEANUP compared_static)
endif(MINIZIP_BUILD_STATIC)
add_subdirectory(test)
endif(MINIZIP_BUILD_TESTING)
@@ -1,58 +0,0 @@
This is version 2009-Jan-02 of the Info-ZIP license. The definitive version of
this document should be available at ftp://ftp.info-
zip.org/pub/infozip/license.html indefinitely and a copy at http://www.info-
zip.org/pub/infozip/license.html.
Copyright (c) 1990-2009 Info-ZIP. All rights reserved.
For the purposes of this copyright and license, "Info-ZIP" is defined as the
following set of individuals:
Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois, Jean-
loup Gailly, Hunter Goatley, Ed Gordon, Ian Gorman, Chris Herborth, Dirk
Haase, Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz, David
Kirschbaum, Johnny Lee, Onno van der Linden, Igor Mandrichenko, Steve P.
Miller, Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs, Kai Uwe
Rommel, Steve Salisbury, Dave Smith, Steven M. Schweda, Christian Spieler,
Cosmin Truta, Antoine Verheijen, Paul von Behren, Rich Wales, Mike White.
This software is provided "as is," without warranty of any kind, express or
implied. In no event shall Info-ZIP or its contributors be held liable for any
direct, indirect, incidental, special or consequential damages arising out of
the use of or inability to use this software.
Permission is granted to anyone to use this software for any purpose, including
commercial applications, and to alter it and redistribute it freely, subject to
the above disclaimer and the following restrictions:
Redistributions of source code (in whole or in part) must retain the above
copyright notice, definition, disclaimer, and this list of conditions.
Redistributions in binary form (compiled executables and libraries) must
reproduce the above copyright notice, definition, disclaimer, and this list
of conditions in documentation and/or other materials provided with the
distribution. Additional documentation is not needed for executables where a
command line license option provides these and a note regarding this option
is in the executable's startup banner. The sole exception to this condition
is redistribution of a standard UnZipSFX binary (including SFXWiz) as part
of a self-extracting archive; that is permitted without inclusion of this
license, as long as the normal SFX banner has not been removed from the
binary or disabled.
Altered versions--including, but not limited to, ports to new operating
systems, existing ports with new graphical interfaces, versions with
modified or added functionality, and dynamic, shared, or static library
versions not from Info-ZIP--must be plainly marked as such and must not be
misrepresented as being the original source or, if binaries, compiled from
the original source. Such altered versions also must not be misrepresented
as being Info-ZIP releases--including, but not limited to, labeling of the
altered versions with the names "Info-ZIP" (or any variation thereof,
including, but not limited to, different capitalizations), "Pocket UnZip,"
"WiZ" or "MacZip" without the explicit permission of Info-ZIP. Such altered
versions are further prohibited from misrepresentative use of the Zip-Bugs
or Info-ZIP e-mail addresses or the Info-ZIP URL(s), such as to imply Info-
ZIP will provide support for the altered versions.
Info-ZIP retains the right to use the names "Info-ZIP," "Zip," "UnZip,"
"UnZipSFX," "WiZ," "Pocket UnZip," "Pocket Zip," and "MacZip" for its own
source and binary releases.
+10 -14
View File
@@ -1,25 +1,21 @@
CPPFLAGS = -I../..
CC?=cc
CFLAGS := $(CFLAGS) -O -I../..
UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a
ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a
.c.o:
$(CC) -c $(CFLAGS) $*.c
all: miniunz minizip
miniunz.o: miniunz.c unzip.h iowin32.h
minizip.o: minizip.c zip.h iowin32.h ints.h
unzip.o: unzip.c unzip.h crypt.h
zip.o: zip.c zip.h crypt.h skipset.h ints.h
ioapi.o: ioapi.c ioapi.h ints.h
iowin32.o: iowin32.c iowin32.h ioapi.h
mztools.o: mztools.c unzip.h
miniunz: $(UNZ_OBJS)
$(CC) $(CFLAGS) -o $@ $(UNZ_OBJS)
miniunz: $(UNZ_OBJS)
${CC} ${LDFLAGS} -o $@ $(UNZ_OBJS)
minizip: $(ZIP_OBJS)
$(CC) $(CFLAGS) -o $@ $(ZIP_OBJS)
minizip: $(ZIP_OBJS)
${CC} ${LDFLAGS} -o $@ $(ZIP_OBJS)
test: miniunz minizip
test: miniunz minizip
@rm -f test.*
@echo hello hello hello > test.txt
./minizip test test.txt
+10 -5
View File
@@ -1,8 +1,8 @@
MiniZip - Copyright (c) 1998-2026 - by Gilles Vollant - version 1.1 64 bits from Mathias Svensson
MiniZip - Copyright (c) 1998-2010 - by Gilles Vollant - version 1.1 64 bits from Mathias Svensson
Introduction
---------------------
MiniZip 1.1 is built from MiniZip 1.0 by Gilles Vollant ( https://www.winimage.com/zLibDll/minizip.html )
MiniZip 1.1 is built from MiniZip 1.0 by Gilles Vollant ( http://www.winimage.com/zLibDll/minizip.html )
When adding ZIP64 support into minizip it would result into risk of breaking compatibility with minizip 1.0.
All possible work was done for compatibility.
@@ -11,7 +11,7 @@ All possible work was done for compatibility.
Background
---------------------
When adding ZIP64 support Mathias Svensson found that Even Rouault have added ZIP64
support for unzip.c into minizip for a open source project called gdal ( https://www.gdal.org/ )
support for unzip.c into minizip for a open source project called gdal ( http://www.gdal.org/ )
That was used as a starting point. And after that ZIP64 support was added to zip.c
some refactoring and code cleanup was also done.
@@ -36,9 +36,14 @@ Credits
Mathias Svensson - ZIP64 zip support
Mathias Svensson - BZip Compression method support in zip
Resource
Resources
ZIP App Note https://www.pkware.com/documents/casestudies/APPNOTE.TXT
ZipLayout http://result42.com/projects/ZipFileLayout
Command line tool for Windows that shows the layout and information of the headers in a zip archive.
Used when debugging and validating the creation of zip files using MiniZip64
ZIP App Note http://www.pkware.com/documents/casestudies/APPNOTE.TXT
Zip File specification
+2 -2
View File
@@ -1,13 +1,13 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_INIT([minizip], [1.3.2], [bugzilla.redhat.com])
AC_INIT([minizip], [1.3.1], [bugzilla.redhat.com])
AC_CONFIG_SRCDIR([minizip.c])
AM_INIT_AUTOMAKE([foreign])
LT_INIT
AC_MSG_CHECKING([whether to build example programs])
AC_ARG_ENABLE([demos], AS_HELP_STRING([--enable-demos], [build example programs]))
AC_ARG_ENABLE([demos], AC_HELP_STRING([--enable-demos], [build example programs]))
AM_CONDITIONAL([COND_DEMOS], [test "$enable_demos" = yes])
if test "$enable_demos" = yes
then
+6 -3
View File
@@ -1,6 +1,9 @@
/* crypt.h -- base code for crypt/uncrypt ZIPfile
Copyright (C) 1998-2026 Gilles Vollant
Version 1.01e, February 12th, 2005
Copyright (C) 1998-2005 Gilles Vollant
This code is a modified version of crypting code in Infozip distribution
@@ -20,7 +23,7 @@
This code support the "Traditional PKWARE Encryption".
The new AES encryption added on Zip format by Winzip (see the page
https://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong
http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong
Encryption is not supported.
*/
@@ -103,7 +106,7 @@ static unsigned crypthead(const char* passwd, /* password string */
*/
if (++calls == 1)
{
srand((unsigned)time(NULL) ^ ZCR_SEED2);
srand((unsigned)(time(NULL) ^ ZCR_SEED2));
}
init_keys(passwd, pkeys, pcrc_32_tab);
for (n = 0; n < RAND_HEAD_LEN-2; n++)
-57
View File
@@ -1,57 +0,0 @@
/* ints.h -- create integer types for 8, 16, 32, and 64 bits
* Copyright (C) 2024 Mark Adler
* For conditions of distribution and use, see the copyright notice in zlib.h
*
* There exist compilers with limits.h, but not stdint.h or inttypes.h.
*/
#ifndef INTS_H
#define INTS_H
#include <limits.h>
#if defined(UCHAR_MAX) && UCHAR_MAX == 0xff
typedef signed char i8_t;
typedef unsigned char ui8_t;
#else
# error "no 8-bit integer"
#endif
#if defined(USHRT_MAX) && USHRT_MAX == 0xffff
typedef short i16_t;
typedef unsigned short ui16_t;
#elif defined(UINT_MAX) && UINT_MAX == 0xffff
typedef int i16_t;
typedef unsigned ui16_t;
#else
# error "no 16-bit integer"
#endif
#if defined(UINT_MAX) && UINT_MAX == 0xffffffff
typedef int i32_t;
typedef unsigned ui32_t;
# define PI32 "d"
# define PUI32 "u"
#elif defined(ULONG_MAX) && ULONG_MAX == 0xffffffff
typedef long i32_t;
typedef unsigned long ui32_t;
# define PI32 "ld"
# define PUI32 "lu"
#else
# error "no 32-bit integer"
#endif
#if defined(ULONG_MAX) && ULONG_MAX == 0xffffffffffffffff
typedef long i64_t;
typedef unsigned long ui64_t;
# define PI64 "ld"
# define PUI64 "lu"
#elif defined(ULLONG_MAX) && ULLONG_MAX == 0xffffffffffffffff
typedef long long i64_t;
typedef unsigned long long ui64_t;
# define PI64 "lld"
# define PUI64 "llu"
#elif defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 0xffffffffffffffff
typedef long long i64_t;
typedef unsigned long long ui64_t;
# define PI64 "lld"
# define PUI64 "llu"
#else
# error "no 64-bit integer"
#endif
#endif
+9 -5
View File
@@ -1,10 +1,10 @@
/* ioapi.h -- IO base function header for compress/uncompress .zip
part of the MiniZip project - ( https://www.winimage.com/zLibDll/minizip.html )
part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2026 Gilles Vollant (minizip) ( https://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
Modifications for Zip64 support
Copyright (C) 2009-2010 Mathias Svensson ( https://result42.com )
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
For more info read MiniZip_info.txt
@@ -14,8 +14,12 @@
#define _CRT_SECURE_NO_WARNINGS
#endif
#if defined(__APPLE__) || defined(IOAPI_NO_64) || defined(__HAIKU__) || defined(MINIZIP_FOPEN_NO_64) || (defined(__ANDROID_API__) && __ANDROID_API__ < 24)
/* In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions */
#if defined(_WIN32)
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
#define FTELLO_FUNC(stream) _ftelli64(stream)
#define FSEEKO_FUNC(stream, offset, origin) _fseeki64(stream, offset, origin)
#elif defined(__APPLE__) || defined(IOAPI_NO_64) || defined(__HAIKU__) || defined(MINIZIP_FOPEN_NO_64)
// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
#define FTELLO_FUNC(stream) ftello(stream)
#define FSEEKO_FUNC(stream, offset, origin) fseeko(stream, offset, origin)
+39 -12
View File
@@ -1,10 +1,10 @@
/* ioapi.h -- IO base function header for compress/uncompress .zip
part of the MiniZip project - ( https://www.winimage.com/zLibDll/minizip.html )
part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2026 Gilles Vollant (minizip) ( https://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
Modifications for Zip64 support
Copyright (C) 2009-2010 Mathias Svensson ( https://result42.com )
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
For more info read MiniZip_info.txt
@@ -18,13 +18,13 @@
*/
#ifndef ZLIBIOAPI64_H
#define ZLIBIOAPI64_H
#ifndef _ZLIBIOAPI64_H
#define _ZLIBIOAPI64_H
#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) && (!(defined(__ANDROID_API__) || __ANDROID_API__ >= 24))
#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__))
/* Linux needs this to support file operation on files larger then 4+GB */
/* But might need better if/def to select just the platforms that needs them.*/
// Linux needs this to support file operation on files larger then 4+GB
// But might need better if/def to select just the platforms that needs them.
#ifndef __USE_FILE_OFFSET64
#define __USE_FILE_OFFSET64
@@ -67,12 +67,39 @@
#endif
#endif
/*
#ifndef ZPOS64_T
#ifdef _WIN32
#define ZPOS64_T fpos_t
#else
#include <stdint.h>
#define ZPOS64_T uint64_t
#endif
#endif
*/
#ifdef HAVE_MINIZIP64_CONF_H
#include "mz64conf.h"
#endif
#include "ints.h"
typedef ui64_t ZPOS64_T;
/* a type chosen by DEFINE */
#ifdef HAVE_64BIT_INT_CUSTOM
typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T;
#else
#ifdef HAS_STDINT_H
#include "stdint.h"
typedef uint64_t ZPOS64_T;
#else
#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef unsigned __int64 ZPOS64_T;
#else
typedef unsigned long long int ZPOS64_T;
#endif
#endif
#endif
/* Maximum unsigned 32-bit value used as placeholder for zip64 */
#ifndef MAXU32
@@ -161,8 +188,8 @@ typedef struct zlib_filefunc64_32_def_s
#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))
#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))
/*#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) */
/*#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) */
//#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream))
//#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode))
#define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream))
#define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream))
+9 -16
View File
@@ -1,10 +1,11 @@
/* iowin32.c -- IO base function header for compress/uncompress .zip
part of the MiniZip project - ( https://www.winimage.com/zLibDll/minizip.html )
Version 1.1, February 14h, 2010
part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2026 Gilles Vollant (minizip) ( https://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
Modifications for Zip64 support
Copyright (C) 2009-2010 Mathias Svensson ( https://result42.com )
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
For more info read MiniZip_info.txt
@@ -25,7 +26,7 @@
#endif
/* see Include/shared/winapifamily.h in the Windows Kit */
// see Include/shared/winapifamily.h in the Windows Kit
#if defined(WINAPI_FAMILY_PARTITION) && (!(defined(IOWIN32_USING_WINRT_API)))
#if !defined(WINAPI_FAMILY_ONE_PARTITION)
@@ -88,7 +89,7 @@ static voidpf win32_build_iowin(HANDLE hFile) {
}
voidpf ZCALLBACK win32_open64_file_func(voidpf opaque, const void* filename, int mode) {
(void)opaque;
const char* mode_fopen = NULL;
DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
HANDLE hFile = NULL;
@@ -116,7 +117,7 @@ voidpf ZCALLBACK win32_open64_file_func(voidpf opaque, const void* filename, int
voidpf ZCALLBACK win32_open64_file_funcA(voidpf opaque, const void* filename, int mode) {
(void)opaque;
const char* mode_fopen = NULL;
DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
HANDLE hFile = NULL;
@@ -139,7 +140,7 @@ voidpf ZCALLBACK win32_open64_file_funcA(voidpf opaque, const void* filename, in
voidpf ZCALLBACK win32_open64_file_funcW(voidpf opaque, const void* filename, int mode) {
(void)opaque;
const char* mode_fopen = NULL;
DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
HANDLE hFile = NULL;
@@ -158,7 +159,7 @@ voidpf ZCALLBACK win32_open64_file_funcW(voidpf opaque, const void* filename, in
voidpf ZCALLBACK win32_open_file_func(voidpf opaque, const char* filename, int mode) {
(void)opaque;
const char* mode_fopen = NULL;
DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
HANDLE hFile = NULL;
@@ -186,7 +187,6 @@ voidpf ZCALLBACK win32_open_file_func(voidpf opaque, const char* filename, int m
uLong ZCALLBACK win32_read_file_func(voidpf opaque, voidpf stream, void* buf,uLong size) {
(void)opaque;
uLong ret=0;
HANDLE hFile = NULL;
if (stream!=NULL)
@@ -208,7 +208,6 @@ uLong ZCALLBACK win32_read_file_func(voidpf opaque, voidpf stream, void* buf,uLo
uLong ZCALLBACK win32_write_file_func(voidpf opaque, voidpf stream, const void* buf, uLong size) {
(void)opaque;
uLong ret=0;
HANDLE hFile = NULL;
if (stream!=NULL)
@@ -248,7 +247,6 @@ static BOOL MySetFilePointerEx(HANDLE hFile, LARGE_INTEGER pos, LARGE_INTEGER *n
}
long ZCALLBACK win32_tell_file_func(voidpf opaque, voidpf stream) {
(void)opaque;
long ret=-1;
HANDLE hFile = NULL;
if (stream!=NULL)
@@ -271,7 +269,6 @@ long ZCALLBACK win32_tell_file_func(voidpf opaque, voidpf stream) {
}
ZPOS64_T ZCALLBACK win32_tell64_file_func(voidpf opaque, voidpf stream) {
(void)opaque;
ZPOS64_T ret= (ZPOS64_T)-1;
HANDLE hFile = NULL;
if (stream!=NULL)
@@ -296,7 +293,6 @@ ZPOS64_T ZCALLBACK win32_tell64_file_func(voidpf opaque, voidpf stream) {
long ZCALLBACK win32_seek_file_func(voidpf opaque, voidpf stream, uLong offset, int origin) {
(void)opaque;
DWORD dwMoveMethod=0xFFFFFFFF;
HANDLE hFile = NULL;
@@ -334,7 +330,6 @@ long ZCALLBACK win32_seek_file_func(voidpf opaque, voidpf stream, uLong offset,
}
long ZCALLBACK win32_seek64_file_func(voidpf opaque, voidpf stream, ZPOS64_T offset, int origin) {
(void)opaque;
DWORD dwMoveMethod=0xFFFFFFFF;
HANDLE hFile = NULL;
long ret=-1;
@@ -373,7 +368,6 @@ long ZCALLBACK win32_seek64_file_func(voidpf opaque, voidpf stream, ZPOS64_T off
}
int ZCALLBACK win32_close_file_func(voidpf opaque, voidpf stream) {
(void)opaque;
int ret=-1;
if (stream!=NULL)
@@ -391,7 +385,6 @@ int ZCALLBACK win32_close_file_func(voidpf opaque, voidpf stream) {
}
int ZCALLBACK win32_error_file_func(voidpf opaque, voidpf stream) {
(void)opaque;
int ret=-1;
if (stream!=NULL)
{
+4 -3
View File
@@ -1,10 +1,11 @@
/* iowin32.h -- IO base function header for compress/uncompress .zip
part of the MiniZip project - ( https://www.winimage.com/zLibDll/minizip.html )
Version 1.1, February 14h, 2010
part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2026 Gilles Vollant (minizip) ( https://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
Modifications for Zip64 support
Copyright (C) 2009-2010 Mathias Svensson ( https://result42.com )
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
For more info read MiniZip_info.txt
+1 -1
View File
@@ -2,7 +2,7 @@ $ if f$search("ioapi.h_orig") .eqs. "" then copy ioapi.h ioapi.h_orig
$ open/write zdef vmsdefs.h
$ copy sys$input: zdef
$ deck
#define __unix__
#define unix
#define fill_zlib_filefunc64_32_def_from_filefunc32 fillzffunc64from
#define Write_Zip64EndOfCentralDirectoryLocator Write_Zip64EoDLocator
#define Write_Zip64EndOfCentralDirectoryRecord Write_Zip64EoDRecord
+24 -24
View File
@@ -1,14 +1,15 @@
/*
miniunz.c
sample part of the MiniZip project - ( https://www.winimage.com/zLibDll/minizip.html )
Version 1.1, February 14h, 2010
sample part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2026 Gilles Vollant (minizip) ( https://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
Modifications of Unzip for Zip64
Copyright (C) 2007-2008 Even Rouault
Modifications for Zip64 support on both zip and unzip
Copyright (C) 2009-2010 Mathias Svensson ( https://result42.com )
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
*/
#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__))
@@ -38,9 +39,6 @@
#endif
#ifndef _CRT_SECURE_NO_WARNINGS
# define _CRT_SECURE_NO_WARNINGS
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -85,7 +83,6 @@
tmu_date : the SAME new date at the tm_unz format */
static void change_file_date(const char *filename, uLong dosdate, tm_unz tmu_date) {
#ifdef _WIN32
(void)tmu_date;
HANDLE hFile;
FILETIME ftm,ftLocal,ftCreate,ftLastAcc,ftLastWrite;
@@ -96,7 +93,8 @@ static void change_file_date(const char *filename, uLong dosdate, tm_unz tmu_dat
LocalFileTimeToFileTime(&ftLocal,&ftm);
SetFileTime(hFile,&ftm,&ftLastAcc,&ftm);
CloseHandle(hFile);
#elif defined(__unix__) || defined(__unix) || defined(__APPLE__)
#else
#if defined(unix) || defined(__APPLE__)
(void)dosdate;
struct utimbuf ut;
struct tm newdate;
@@ -118,6 +116,7 @@ static void change_file_date(const char *filename, uLong dosdate, tm_unz tmu_dat
(void)dosdate;
(void)tmu_date;
#endif
#endif
}
@@ -128,7 +127,9 @@ static int mymkdir(const char* dirname) {
int ret=0;
#ifdef _WIN32
ret = _mkdir(dirname);
#elif defined(__unix__) || defined(__unix) || defined(__APPLE__)
#elif unix
ret = mkdir (dirname,0775);
#elif __APPLE__
ret = mkdir (dirname,0775);
#else
(void)dirname;
@@ -150,7 +151,7 @@ static int makedir(const char *newdir) {
printf("Error allocating memory\n");
return UNZ_INTERNALERROR;
}
memcpy(buffer,newdir,len+1);
strcpy(buffer,newdir);
if (buffer[len-1] == '/') {
buffer[len-1] = '\0';
@@ -186,7 +187,7 @@ static int makedir(const char *newdir) {
static void do_banner(void) {
printf("MiniUnz 1.1, demo of zLib + Unz package written by Gilles Vollant\n");
printf("more info at https://www.winimage.com/zLibDll/unzip.html\n\n");
printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n");
}
static void do_help(void) {
@@ -234,12 +235,12 @@ static int do_list(unzFile uf) {
err = unzGetGlobalInfo64(uf,&gi);
if (err!=UNZ_OK)
printf("error %d with zipfile in unzGetGlobalInfo\n",err);
printf("error %d with zipfile in unzGetGlobalInfo \n",err);
printf(" Length Method Size Ratio Date Time CRC-32 Name\n");
printf(" ------ ------ ---- ----- ---- ---- ------ ----\n");
for (i=0;i<gi.number_entry;i++)
{
char filename_inzip[65536+1];
char filename_inzip[256];
unz_file_info64 file_info;
uLong ratio=0;
const char *string_method = "";
@@ -304,7 +305,7 @@ static int do_list(unzFile uf) {
static int do_extract_currentfile(unzFile uf, const int* popt_extract_without_path, int* popt_overwrite, const char* password) {
char filename_inzip[65536+1];
char filename_inzip[256];
char* filename_withoutpath;
char* p;
int err=UNZ_OK;
@@ -481,17 +482,13 @@ static int do_extract(unzFile uf, int opt_extract_without_path, int opt_overwrit
err = unzGetGlobalInfo64(uf,&gi);
if (err!=UNZ_OK)
{
printf("error %d with zipfile in unzGetGlobalInfo\n",err);
return err;
}
printf("error %d with zipfile in unzGetGlobalInfo \n",err);
for (i=0;i<gi.number_entry;i++)
{
err = do_extract_currentfile(uf,&opt_extract_without_path,
if (do_extract_currentfile(uf,&opt_extract_without_path,
&opt_overwrite,
password);
if (err != UNZ_OK)
password) != UNZ_OK)
break;
if ((i+1)<gi.number_entry)
@@ -505,7 +502,7 @@ static int do_extract(unzFile uf, int opt_extract_without_path, int opt_overwrit
}
}
return err;
return 0;
}
static int do_extract_onefile(unzFile uf, const char* filename, int opt_extract_without_path, int opt_overwrite, const char* password) {
@@ -515,9 +512,12 @@ static int do_extract_onefile(unzFile uf, const char* filename, int opt_extract_
return 2;
}
return do_extract_currentfile(uf,&opt_extract_without_path,
if (do_extract_currentfile(uf,&opt_extract_without_path,
&opt_overwrite,
password);
password) == UNZ_OK)
return 0;
else
return 1;
}
+46 -47
View File
@@ -1,14 +1,15 @@
/*
minizip.c
sample part of the MiniZip project - ( https://www.winimage.com/zLibDll/minizip.html )
Version 1.1, February 14h, 2010
sample part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2026 Gilles Vollant (minizip) ( https://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
Modifications of Unzip for Zip64
Copyright (C) 2007-2008 Even Rouault
Modifications for Zip64 support on both zip and unzip
Copyright (C) 2009-2010 Mathias Svensson ( https://result42.com )
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
*/
@@ -27,7 +28,11 @@
#endif
#endif
#if defined(__APPLE__) || defined(__HAIKU__) || defined(MINIZIP_FOPEN_NO_64)
#if defined(_WIN32)
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
#define FTELLO_FUNC(stream) _ftelli64(stream)
#define FSEEKO_FUNC(stream, offset, origin) _fseeki64(stream, offset, origin)
#elif defined(__APPLE__) || defined(IOAPI_NO_64)
// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
#define FTELLO_FUNC(stream) ftello(stream)
@@ -38,14 +43,7 @@
#define FSEEKO_FUNC(stream, offset, origin) fseeko64(stream, offset, origin)
#endif
#ifndef _CRT_SECURE_NO_WARNINGS
# define _CRT_SECURE_NO_WARNINGS
#endif
#ifdef HAVE_DIRENT_H
# include <dirent.h>
#endif
#include "tinydir.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -64,11 +62,13 @@
#endif
#include "zip.h"
#include "ints.h"
#ifdef _WIN32
#define USEWIN32IOAPI
#include "iowin32.h"
# if defined(_MSC_VER)
# define snprintf _snprintf
# endif
#endif
@@ -80,7 +80,6 @@
/* f: name of file to get info on, tmzip: return value: access,
modification and creation times, dt: dostime */
static int filetime(const char *f, tm_zip *tmzip, uLong *dt) {
(void)tmzip;
int ret = 0;
{
FILETIME ftLocal;
@@ -98,7 +97,8 @@ static int filetime(const char *f, tm_zip *tmzip, uLong *dt) {
}
return ret;
}
#elif defined(__unix__) || defined(__unix) || defined(__APPLE__)
#else
#if defined(unix) || defined(__APPLE__)
/* f: name of file to get info on, tmzip: return value: access,
modification and creation times, dt: dostime */
static int filetime(const char *f, tm_zip *tmzip, uLong *dt) {
@@ -149,6 +149,7 @@ static int filetime(const char *f, tm_zip *tmzip, uLong *dt) {
return 0;
}
#endif
#endif
@@ -166,11 +167,11 @@ static int check_exist_file(const char* filename) {
static void do_banner(void) {
printf("MiniZip 1.1, demo of zLib + MiniZip64 package, written by Gilles Vollant\n");
printf("more info on MiniZip at https://www.winimage.com/zLibDll/minizip.html\n\n");
printf("more info on MiniZip at http://www.winimage.com/zLibDll/minizip.html\n\n");
}
static void do_help(void) {
printf("Usage : minizip [-r] [-o] [-a] [-0 to -9] [-p password] [-j] file.zip [files_to_add]\n\n" \
printf("Usage : minizip [-o] [-a] [-0 to -9] [-p password] [-j] file.zip [files_to_add]\n\n" \
" -r Scan directories recursively\n" \
" -o Overwrite existing file.zip\n" \
" -a Append to existing file.zip\n" \
@@ -198,7 +199,7 @@ static int getFileCrc(const char* filenameinzip, void* buf, unsigned long size_b
do
{
err = ZIP_OK;
size_read = (unsigned long)fread(buf,1,size_buf,fin);
size_read = fread(buf,1,size_buf,fin);
if (size_read < size_buf)
if (feof(fin)==0)
{
@@ -230,7 +231,7 @@ static int isLargeFile(const char* filename) {
FSEEKO_FUNC(pFile, 0, SEEK_END);
pos = (ZPOS64_T)FTELLO_FUNC(pFile);
printf("File : %s is %"PUI64" bytes\n", filename, pos);
printf("File : %s is %llu bytes\n", filename, pos);
if(pos >= 0xffffffff)
largeFile = 1;
@@ -242,8 +243,8 @@ static int isLargeFile(const char* filename) {
}
void addFileToZip(zipFile zf, const char *filenameinzip, const char *password, int opt_exclude_path,int opt_compress_level) {
FILE * fin = NULL;
size_t size_read;
FILE * fin;
int size_read;
const char *savefilenameinzip;
zip_fileinfo zi;
unsigned long crcFile=0;
@@ -291,7 +292,7 @@ void addFileToZip(zipFile zf, const char *filenameinzip, const char *password, i
}
if( lastslash != NULL )
{
savefilenameinzip = lastslash+1; /* base filename follows last slash. */
savefilenameinzip = lastslash+1; // base filename follows last slash.
}
}
@@ -320,7 +321,7 @@ void addFileToZip(zipFile zf, const char *filenameinzip, const char *password, i
do
{
err = ZIP_OK;
size_read = fread(buf,1,size_buf,fin);
size_read = (int)fread(buf,1,size_buf,fin);
if (size_read < size_buf)
if (feof(fin)==0)
{
@@ -330,7 +331,7 @@ void addFileToZip(zipFile zf, const char *filenameinzip, const char *password, i
if (size_read>0)
{
err = zipWriteInFileInZip (zf,buf,(unsigned)size_read);
err = zipWriteInFileInZip (zf,buf,size_read);
if (err<0)
{
printf("error in writing %s in the zipfile\n",
@@ -356,30 +357,28 @@ void addFileToZip(zipFile zf, const char *filenameinzip, const char *password, i
void addPathToZip(zipFile zf, const char *filenameinzip, const char *password, int opt_exclude_path,int opt_compress_level) {
#ifdef HAVE_DIRENT_H
# if defined(_MSC_VER)
# define snprintf _snprintf
# endif
tinydir_dir dir;
int i;
char newname[MAXFILENAME+1+MAXFILENAME+1];
struct dirent *dp;
DIR *dir = opendir(filenameinzip);
if (dir == NULL) {
addFileToZip(zf,filenameinzip,password,opt_exclude_path,opt_compress_level);
return;
}
while ((dp = readdir(dir)))
tinydir_open_sorted(&dir, filenameinzip);
for (i = 0; i < dir.n_files; i++)
{
if(strcmp(dp->d_name,".")==0) continue;
if(strcmp(dp->d_name,"..")==0) continue;
snprintf(newname, sizeof(newname), "%.*s/%.*s", MAXFILENAME, filenameinzip, MAXFILENAME, dp->d_name);
addPathToZip(zf,newname,password,opt_exclude_path,opt_compress_level);
tinydir_file file;
tinydir_readfile_n(&dir, &file, i);
if(strcmp(file.name,".")==0) continue;
if(strcmp(file.name,"..")==0) continue;
snprintf(newname, sizeof(newname), "%.*s/%.*s", MAXFILENAME, dir.path, MAXFILENAME, file.name);
if (file.is_dir)
{
addPathToZip(zf,newname,password,opt_exclude_path,opt_compress_level);
} else {
addFileToZip(zf,newname,password,opt_exclude_path,opt_compress_level);
}
}
closedir(dir);
#else
printf("-r option not supported");
#endif
tinydir_close(&dir);
}
@@ -393,7 +392,7 @@ int main(int argc, char *argv[]) {
char filename_try[MAXFILENAME+16];
int zipok;
int err=0;
unsigned long size_buf=0;
size_t size_buf=0;
void* buf=NULL;
const char* password=NULL;
@@ -457,7 +456,7 @@ int main(int argc, char *argv[]) {
}
else
{
int len;
int i,len;
int dot_found=0;
zipok = 1 ;
@@ -533,7 +532,7 @@ int main(int argc, char *argv[]) {
(argv[i][1]=='a') || (argv[i][1]=='A') ||
(argv[i][1]=='p') || (argv[i][1]=='P') ||
(argv[i][1]=='r') || (argv[i][1]=='R') ||
((argv[i][1]>='0') && (argv[i][1]<='9'))) &&
((argv[i][1]>='0') || (argv[i][1]<='9'))) &&
(strlen(argv[i]) == 2)))
{
if(opt_recursive) {
@@ -553,5 +552,5 @@ int main(int argc, char *argv[]) {
}
free(buf);
return err;
return 0;
}
+1 -2
View File
@@ -1,13 +1,12 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
includedir=@includedir@/minizip
Name: minizip
Description: Minizip zip file manipulation library
Requires:
Version: @PACKAGE_VERSION@
License: Zlib
Libs: -L${libdir} -lminizip
Libs.private: -lz
Cflags: -I${includedir}
@@ -1,13 +0,0 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
sharedlibdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${exec_prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: minizip
Description: minizip compression library
Version: @minizip_VERSION@
Requires:
Libs: -L${libdir} -L${sharedlibdir} -lz -lminizip
Cflags: -I${includedir}
@@ -1,27 +0,0 @@
@PACKAGE_INIT@
set(_MINIZIP_supported_components "shared" "static")
include(CMakeFindDependencyMacro)
if(@MINIZIP_ENABLE_BZIP2@)
find_dependency(BZip2)
endif(@MINIZIP_ENABLE_BZIP2@)
if(minizip_FIND_COMPONENTS)
find_dependency(ZLIB CONFIG COMPONENTS ${minizip_FIND_COMPONENTS})
foreach(_comp ${minizip_FIND_COMPONENTS})
if(NOT _comp IN_LIST _MINIZIP_supported_components)
set(minizip_FOUND False)
set(minizip_NOT_FOUND_MESSAGE "Unsupported component: ${_comp}")
endif(NOT _comp IN_LIST _MINIZIP_supported_components)
include("${CMAKE_CURRENT_LIST_DIR}/minizip-${_comp}.cmake")
endforeach(_comp ${ZLIB_FIND_COMPONENTS})
else(minizip_FIND_COMPONENTS)
find_dependency(ZLIB CONFIG)
foreach(_component_config IN LISTS _MINIZIP_supported_components)
include("${CMAKE_CURRENT_LIST_DIR}/minizip-${_component_config}.cmake")
endforeach(_component_config IN LISTS _MINIZIP_supported_components)
endif(minizip_FIND_COMPONENTS)
+31 -40
View File
@@ -5,9 +5,6 @@
*/
/* Code */
#ifndef _CRT_SECURE_NO_WARNINGS
# define _CRT_SECURE_NO_WARNINGS
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -35,7 +32,7 @@ extern int ZEXPORT unzRepair(const char* file, const char* fileOut, const char*
FILE* fpZip = fopen(file, "rb");
FILE* fpOut = fopen(fileOut, "wb");
FILE* fpOutCD = fopen(fileOutTmp, "wb");
if (fpZip != NULL && fpOut != NULL && fpOutCD != NULL ) {
if (fpZip != NULL && fpOut != NULL) {
int entries = 0;
uLong totalBytes = 0;
char header[30];
@@ -143,28 +140,28 @@ extern int ZEXPORT unzRepair(const char* file, const char* fileOut, const char*
/* Central directory entry */
{
char central[46];
char header[46];
char* comment = "";
int comsize = (int) strlen(comment);
WRITE_32(central, 0x02014b50);
WRITE_16(central + 4, version);
WRITE_16(central + 6, version);
WRITE_16(central + 8, gpflag);
WRITE_16(central + 10, method);
WRITE_16(central + 12, filetime);
WRITE_16(central + 14, filedate);
WRITE_32(central + 16, crc);
WRITE_32(central + 20, cpsize);
WRITE_32(central + 24, uncpsize);
WRITE_16(central + 28, fnsize);
WRITE_16(central + 30, extsize);
WRITE_16(central + 32, comsize);
WRITE_16(central + 34, 0); /* disk # */
WRITE_16(central + 36, 0); /* int attrb */
WRITE_32(central + 38, 0); /* ext attrb */
WRITE_32(central + 42, currentOffset);
WRITE_32(header, 0x02014b50);
WRITE_16(header + 4, version);
WRITE_16(header + 6, version);
WRITE_16(header + 8, gpflag);
WRITE_16(header + 10, method);
WRITE_16(header + 12, filetime);
WRITE_16(header + 14, filedate);
WRITE_32(header + 16, crc);
WRITE_32(header + 20, cpsize);
WRITE_32(header + 24, uncpsize);
WRITE_16(header + 28, fnsize);
WRITE_16(header + 30, extsize);
WRITE_16(header + 32, comsize);
WRITE_16(header + 34, 0); /* disk # */
WRITE_16(header + 36, 0); /* int attrb */
WRITE_32(header + 38, 0); /* ext attrb */
WRITE_32(header + 42, currentOffset);
/* Header */
if (fwrite(central, 1, 46, fpOutCD) == 46) {
if (fwrite(header, 1, 46, fpOutCD) == 46) {
offsetCD += 46;
/* Filename */
@@ -218,23 +215,23 @@ extern int ZEXPORT unzRepair(const char* file, const char* fileOut, const char*
/* Final central directory */
{
int entriesZip = entries;
char end[22];
char* comment = ""; /* "ZIP File recovered by zlib/minizip/mztools"; */
char header[22];
char* comment = ""; // "ZIP File recovered by zlib/minizip/mztools";
int comsize = (int) strlen(comment);
if (entriesZip > 0xffff) {
entriesZip = 0xffff;
}
WRITE_32(end, 0x06054b50);
WRITE_16(end + 4, 0); /* disk # */
WRITE_16(end + 6, 0); /* disk # */
WRITE_16(end + 8, entriesZip); /* hack */
WRITE_16(end + 10, entriesZip); /* hack */
WRITE_32(end + 12, offsetCD); /* size of CD */
WRITE_32(end + 16, offset); /* offset to CD */
WRITE_16(end + 20, comsize); /* comment */
WRITE_32(header, 0x06054b50);
WRITE_16(header + 4, 0); /* disk # */
WRITE_16(header + 6, 0); /* disk # */
WRITE_16(header + 8, entriesZip); /* hack */
WRITE_16(header + 10, entriesZip); /* hack */
WRITE_32(header + 12, offsetCD); /* size of CD */
WRITE_32(header + 16, offset); /* offset to CD */
WRITE_16(header + 20, comsize); /* comment */
/* Header */
if (fwrite(end, 1, 22, fpOutCD) == 22) {
if (fwrite(header, 1, 22, fpOutCD) == 22) {
/* Comment field */
if (comsize > 0) {
@@ -282,12 +279,6 @@ extern int ZEXPORT unzRepair(const char* file, const char* fileOut, const char*
}
}
} else {
if (fpOutCD != NULL)
fclose(fpOutCD);
if (fpZip != NULL)
fclose(fpZip);
if (fpOut != NULL)
fclose(fpOut);
err = Z_STREAM_ERROR;
}
return err;

Some files were not shown because too many files have changed in this diff Show More