• src/xpdev/genwrap.c

    From rswindell@1:103/705 to CVS commit on Sat Aug 8 18:47:26 2020
    src/xpdev genwrap.c 1.116 1.117
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/home/rswindell/sbbs/src/xpdev

    Modified Files:
    genwrap.c
    Log Message:
    Fix safe_strerror() for GNU builds (must use the return value of strerror_r()).


    --- SBBSecho 3.11-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From rswindell@1:103/705 to CVS commit on Sun Aug 9 21:11:45 2020
    src/xpdev genwrap.c 1.117 1.118
    Update of /cvsroot/sbbs/src/xpdev
    In directory cvs:/tmp/cvs-serv32696

    Modified Files:
    genwrap.c
    Log Message:
    Provide a (non-ideal) implementation of safe_strerror() for Borland C builds that don't have strerror_s:
    Error: Unresolved external '_strerror_s' referenced from genwrap


    --- SBBSecho 3.11-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Stephen Hurd@1:103/705 to Git commit to sbbs/master on Tue Nov 10 12:55:53 2020
    https://gitlab.synchro.net/sbbs/sbbs/-/commit/678627dbcfc2b6eab9a7a7cb
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Use the crappy strerror() wrapper for all _WIN32 that's not MSC,not just for Borland.
    --- SBBSecho 3.11-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to Git commit to main/sbbs/master on Thu Dec 2 21:03:26 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/01bda6a85c3621f211f8b5d6
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Work around GetVersionEx deprecation warning/errorFor some reason this deprecation warning is being treated as an error (and only with newer Windows platform SDKs). Just disable this warning for the GetVersionEx line.See https://stackoverflow.com/questions/22303824/warning-c4996-getversionexw-was-declared-deprecated for details.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Fri Feb 11 20:49:58 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/f587a43e6fee5458e3376d5a
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    When a double is cast to an int, but the double has a larger valuethan the int supports, it's set to 0x80000000 to indicate overflow.msclock() is *always* overflowing, and clock_t is only 32-bits onsome platforms (specifically FreeBSD). To "avoid" problems, justkeep subtracting UIN32_MAX from the value until it's less than INT_MAXthen cast.This function is, of course, terrible and shouldn't actually be used,but it should at least sorta kinda workish.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Fri Feb 11 23:43:24 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/d2eda12d2c30356cc14461d5
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Fix Win32 builds maybe?
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Fri Feb 11 23:47:10 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/e7761bb1b03cbbf6b3ab0662
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Fix Win32 harder
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Fri Feb 11 23:49:49 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/c3c6d783f4da67a9b2a1f1ed
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Moar!
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to Git commit to main/sbbs/master on Sat Feb 12 00:00:22 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/f0a83672aa0c8d0d638bfd62
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Resolve new msvc warningwarning C4244: '=': conversion from 'double' to 'uint64_t', possible loss of data
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Sat Feb 12 00:07:16 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/f8da2a2f2ff8668017906f48
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    More Win32 optimizations.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Sat Feb 12 00:15:39 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/7d1fc057418fe859028b1c54
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    More Win32 optimizations.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Sat Feb 12 00:40:31 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/489c0c3c20b98f74f54046d0
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Borland doesn't have roundl() so do terrible things instead.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Sat Feb 12 00:45:48 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/0488082a3e46f9cd25efc140
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Not *that* t.
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to Git commit to main/sbbs/master on Fri Feb 25 14:30:46 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/7a3dcb6c2ad19812fd674660
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Fix MSVC warning in xp_timer64()genwrap.c(855): warning C4244: '=': conversion from 'LONGLONG' to 'uint32_t', possible loss of data
    --- SBBSecho 3.14-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to Git commit to main/sbbs/master on Wed Jul 6 21:18:35 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/a302a01b1b42887cdece9b23
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Escape chars >= 0x7f too (DEL and ex-ASCII/UTF-8 and whatnot)
    --- SBBSecho 3.15-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to Git commit to main/sbbs/master on Wed Jul 6 21:23:26 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/735aa51e4f3bcaa8a6640416
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Fix for previous commit and escaped char values > 127 (0x7F)
    --- SBBSecho 3.15-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (in GitKraken)@1:103/705 to Git commit to main/sbbs/master on Sat Mar 11 17:27:03 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/7081a525902dcc4acf4f00a2
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Fix mysterious double overflow issue in parse_byte_count()It's possible that some values (e.g. "16384P") exceed the storage (count ofbytes) of a 64-bit integer, and such values were causing floating pointexceptions when running sbbsctrl.exe, e.g.Faulting application name: sbbsctrl.exe, version: 3.20.0.0, time stamp:0x00000000Faulting module name: gdi32full.dll, version: 10.0.19041.2604, time stamp:0x2b5302d5Exception code: 0xc0000090but interesting (and perhaps a clue), not with sbbs.exe.Anyway, this added range checking, limiting the maximum value to INT64_MAX(after division by unit, though there was no division-unit in the problemcase, the "min_dspace" value parsing in scfglib2.c). Using conditional/ternaryreturn statement had the same floating point exception occurrences, so thisif-statement shouldn't be removed/changed/optimized!I suspect this has something to do with mix of Borland and MSVC run-time libsand perhaps different expectations or setups with regards to floating pointexceptions. I did notice that when stepping through read_file_cfg(), I wouldget different return values for the same call to iniGetBytes() depending onwhether it was initiated from sbbsctrl.exe (built with C++Builder) orsbbs.dll (built with MSVC).Thanks to Codefenix for providing the sample file.ini file that demonstratedthe issue. This problem would've been very hard to root-cause otherwise!
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (in GitKraken)@1:103/705 to Git commit to main/sbbs/master on Fri Mar 17 19:26:55 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/973b548fcd8c126de3633b5c
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Use const doubles for time durationsInstead of copy/pasta. No change in function,.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Tue Mar 28 15:27:09 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/ea44c50ad1ffe1a9cef1a7ff
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Fix clang warning: implicit conversion from 'long' to 'double'changes value from 9223372036854775807 to 9223372036854775808[-Wimplicit-const-int-float-conversion] if(bytes < 0 || bytes > INT64_MAX) ~ ^~~~~~~~~/usr/include/x86/_stdint.h:90:19: note: expanded from macro 'INT64_MAX' #define INT64_MAX 0x7fffffffffffffff ^~~~~~~~~~~~~~~~~~
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Mon Dec 18 02:32:05 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/58b4de5093abeb6c7d2371f1
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    The %g printf specifier doesn't work the same as %f, use %f instead
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Mon Dec 18 17:21:37 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/9031ac11bbc1003e9cd13f3e
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Cosmetic improvements to duration*_to_[v]str() functions

    Use lower case y/w/d/h/m suffix.

    If a duration is an exact multiple, don't display ".0" fraction. This is not consistent with byte_estimate_to_str() string generation, but I think it's
    more in line with human expectations.

    Don't display "90d" as "12.9w" (unless the requested unit is one-week).
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Sat Feb 24 02:08:25 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/984f1eb68d22b45de08fd723
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Insure all builds of safe_strerror() write the string to the passed buf

    The GNU_SOURCE build of this function was (sometimes?) just returning the string and not actually copying it to the passed buf. This is consistent
    with the GNU manpage on strerror_r():
    "This may be either a pointer to a string that the function stores in buf ..." but was inconsistent with all the other build types of this function.

    Also updated to use strlcpy and write the problematic error number to the default string (if unknown).
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Fri Mar 22 11:31:27 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/0d60813bb295908d35ad556e
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Fix issue in last commit

    Need to update the parameter names as well.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Sat Mar 23 00:10:09 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/78ae0fd80623b830fe86b6d6
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Change spaces to tabs in new strlcpy()
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Wed Dec 18 14:52:16 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/746ccfd57d43877a95aaded3
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Attempt to fix musl builds

    The non-standard strerror_r() is glibc specific, musl doesn't do
    that. It *appears* that __USE_GNU implies glibc.
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Thu Dec 19 18:15:35 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/8084997ba19ed4b9c1773003
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Use RtlGetVersion to get/report Windows 11 (and build number) correctly

    This is fun Microsoft. If Windows 11 is actually Windows 10.22000+, what will Windows 12 be? No one can guess.
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Thu Dec 19 18:30:40 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/d58cc13fde38ff3a965dc838
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Move the #pragma warning to just before the call to GetVersionEx()

    Needed for building sbbsexec.dll

    I guess #pramga warning only affects the following source line.

    Apparently we're disabling this warning effectively via other means in all other MSVC projects.
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to Git commit to main/sbbs/master on Thu Dec 19 19:00:53 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/0c385ef21ba3488214dfa917
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Only use RtlGetVersion for Windows 10/11

    This function appears to truncate the service pack info for Windows 7 (6.1): "Windows NT Version 6.1 (Build 7601) Service Pack 1 x86" became:
    "Windows NT Version 6.1 (Build 7601) S x86"

    Don't close the handle to ntdll.dll (hey, that's stupid filename, Microsoft!) since the module could be unloaded from the address space and then a call to the captured procedure address could/would crash. This handle will be closed when the process terminates anyway.

    While we're here, correct the Windows 6.1 -> 7.0 numbering. That looks better: "Windows NT Version 7.0 (Build 7601) Service Pack 1 x86"

    Something should probably be done for Windows 6.2 -> 8.0 numbering too, but I don't have a VM handy. Is anyone actually still running Windows 8.x?
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Tue Dec 24 03:52:05 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/3046bd7ae4c3a503d9c5762d
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Simplify the Windows version detection a bit, don't use NetWkstaGetInfo()

    I started seeing Windows 10.0 reported (without a build number) again on Windows 11 (after a regular update), so changed the logic to always try/use RtlGetVersion() except for Windows 7 where I saw it truncated the Service
    Pack details.
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Fri Jan 3 10:04:55 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/0158699aff72ded56de68882
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Don't return -1 from safe_snprintf() when size is zero.
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Fri Jan 3 13:14:22 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/f5a033dd24945fdd2406c66f
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Annotate risky call to random()
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Wed Jan 8 20:48:18 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/4439557bfaef6655d2979e78
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Seconds not milliseconds.
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Wed Jan 8 20:59:08 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/97434544be0ea793c297bd42
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Actually, CLOCK_SECOND is better than CLOCK_MONOTONIC_FAST

    It's basically CLOCK_REALTIME with tv_nsec set to zero.
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Wed Jan 8 21:02:08 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/cd8e57212957a107d820d7f2
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    If we're older than Vista, use GetTickCount()
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Wed Jan 8 21:08:43 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/68dffbe20c3e00ea9c37b61c
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Check _WIN32_WINNT, not WINVER

    Borland hates WINVER
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Wed Jan 8 21:15:40 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/b02975d7b18d659f1ad0fef3
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Hard-code the _WIN32_WINNT_VISTA value.

    Maybe Borland is also using pre-vista headers?
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to Git commit to main/sbbs/master on Mon Jan 13 09:43:01 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/8f919a6c118cd86c5b672030
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    More fixups for clock selection.
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Tue Feb 4 19:16:47 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/46e28f8d2a3862ae429d59bb
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    When building for Windows Vista+, use GetTickCount64() through-out

    At one point while migrating off the Windows XP compatible WinSDK and toolset, I was getting nice deprecation warnings in this file about uses of GetTickCount() and the 49 day roll-over isuse. I stopped getting those deprecation warnings (not sure when/why), but I'm still doing the right thing here/now and using the newer Win32 API function when it's available (always, for the versions of Windows we're building Synchronet and friends for).
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Tue Feb 4 19:16:47 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/30c26a25035221d8e115bd9e
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Fix common typo in comments
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Tue Feb 4 19:16:47 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/3971fd18f4da0f75b390c17d
    Modified Files:
    src/xpdev/genwrap.c
    Log Message:
    Use strlcpy instead of strncpy to insure termination, suppress MSVC warning
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)