- Feb 24, 2024
-
-
Rob Swindell authored
The definition of vsnprintf as _vsnprintf didn't seem to hurt the build (as well, for Borland)
-
- Feb 21, 2024
-
-
Deucе authored
-
- Feb 20, 2024
- Feb 07, 2024
-
-
Deucе authored
Mingw32 is _WIN32 and GCC, and we need some way to get the free() prototype. :D
-
- Jan 26, 2024
-
-
Deucе authored
-
- Jan 20, 2024
-
-
Rob Swindell authored
Still using BOOL where we need Win32 API compatibility. Using JSBool instead of BOOL or bool where it matters. Changed most relevant TRUE/FALSE to true/false too (though it's not as critical). You shouldn't need to #include <stdbool.h> anywhere now - gen_defs.h should do that automatically/correctly based on the language/version/tool. In C23, stdbool.h isn't even needed for bool/true/false definitions (they're keywords), so we don't bother including stdbool.h in that case. Microsoft didn't define __STDC_VERSION__ in their older tool chains (even though they were C99 compatible and had stdbool.h), so we use a _MSC_VER check to know that there's a stdbool.h we should use in that case. For other/old compilers (e.g. Borland C) we #define bool/true/false following the pattern of stdbool.h (doesn't use a typedef). I didn't convert UIFC yet. This addresses issue #698
-
- Dec 23, 2023
-
-
Rob Swindell authored
Where ever we assign the realloc() result to the same pointer we pass, use this new function instead to eliminate the cppcheck error reported by Nelgin: Common realloc mistake: 'p' nulled but not freed upon failure [memleakOnRealloc] This isn't going to actually solve any memory leaks, it's just good practice for critical error (e.g. no memory error) handling.
-
- Dec 18, 2023
-
-
Rob Swindell authored
Sometimes you want to see "1.5 minutes" (or "1.5M") intead of "90 seconds" (or "90S") I noticed some left over questionable use of ulong here in byte_count related functions, so fixed that.
-
- Jun 26, 2023
-
-
Rob Swindell authored
This macro hasn't done anything meaningful since we stopped using really old versions of Borland compilers (and std libraries) where strerror() returned a string terminated with a line-feed (\n) character.
-
- May 10, 2023
- Apr 26, 2023
-
-
Deucе authored
-
- Nov 12, 2022
-
-
Rob Swindell authored
Also add OS_CPU @-code, to report what CPU architecture the OS thinks it is. Fix the OS_VER @-code truncation bug from previous commit.
-
Rob Swindell authored
Yeah, the Windows block doesn't some unsafe concatenations still.
-
- Mar 24, 2022
-
-
Rob Swindell authored
We don't have a use case negative byte values in strings anywhere that I can think of. Created wrapper for MSFT _ui64toa_() - unsigned 64-bit integer to ASCII string. Add Petabyte (actually, Pebibyte) support to byte_count_to_str() and byte_estimate_to_str(). Removed 'B' suffix from byte_estimate_to_str() output for values < 1024. Callers may display this returned string followed by "bytes" (or similar) and thus the 'B' suffix is redundant in that case. If the caller needs a 'B' suffix, they can detect no suffix and add it.
-
- Mar 14, 2022
-
-
Rob Swindell authored
-
- Feb 12, 2022
-
-
Deucе authored
This is a millisecond timer that tries to avoid floating-point operations.
-
Rob Swindell authored
-
Rob Swindell authored
-
Deucе authored
Now it should keep working after 24 days.
-
- Oct 19, 2021
-
-
Rob Swindell authored
Per https://man7.org/linux/man-pages/man3/pthread_yield.3.html This call is nonstandard, but present on several other systems. Use the standardized sched_yield(2) instead. Should fix #299.
-
- Apr 05, 2021
-
-
Rob Swindell authored
-
- Jan 18, 2021
-
-
Rob Swindell authored
Its a terrible idea to modify the return value of strerror() on any platform. strerror() can (and often does) return immutable string constants - don't try to modify that string even if it does end in trailing white-space (find another solution to that). This change only affects non-*nix builds since we were already doing the right thing for *nix.
-
- Aug 16, 2020
-
-
Rob Swindell authored
-
- Aug 08, 2020
-
-
rswindell authored
Define a thread-safe/re-entrant version of strerror(): safe_strerror() which is just thin wrapper around strerror_s on Windows and strerror_r elsewhere.
-
- Aug 03, 2020
- Apr 14, 2020
-
-
rswindell authored
builds.
-
- Mar 22, 2020
-
-
rswindell authored
nanosleep was interrupted by a signal and the SLEEP parameter is > 1. Previously, any signal wuold abort SLEEP() prematurely. A SLEEP(1) (yield) behaves the same as before since 1 is a special value where a short-sleep duration is fine/expected on occasion.
-
- Sep 10, 2019
-
-
deuce authored
Hopfully this doesn't break the Borland or Watcom (?!) builds.
-
- Apr 11, 2019
-
-
rswindell authored
-
- Jul 23, 2018
-
-
rswindell authored
the number of decimal places in the resulting string.
-
- Jul 20, 2018
-
-
rswindell authored
Created byte_estimate_to_str(), much like byte_count_to_str(), except the byte count is rounded to the nearest tera/giga/mega/kilo-byte (technically tebi/gibi/mebi/kibi-byte, but ugh, I'm old-sk00l!).
-
- Jul 19, 2018
-
-
rswindell authored
-
- Feb 16, 2018
-
-
rswindell authored
We need this for MSVC2013 and MSVC2017 builds.
-
- Nov 05, 2017
-
-
rswindell authored
then a clarifying or modifying word (year[s], month[s], day[s], etc.). parse_byte_count() and parse_duration() now support a space between the numeric value (decimal digits) and the modifier. Hopefully this doesn't break anything, but it makes parse_duration() compatible with the strings generated with duration_to_vstr(). We might want a verbose version of byte_count_to_str() in the future, so I figured it made sense to go ahead and add the white-space skipping/parsing to prase_byte_count() now.
-
- Nov 19, 2016
-
-
sbbs authored
-