Skip to content
Snippets Groups Projects

Compatibility with Source engine

Merged Lassebq requested to merge Lassebq/gcompat:add-wchar-funcs into current
2 unresolved threads

The changes in this MR are necessary for Source-based games to run through gcompat.

  • There are a few changes to formatting, seemingly because source wasn't formatted by the previous contributor.
  • Current implementation of __strncat_chk would cause assertion error in Source.
  • __wcscat_chk and __wcsncpy_chk couldn't be found by dynamic linker.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
247 247
248 248 assert(dest != NULL);
249 249 assert(src != NULL);
250 total = strnlen(dest, destlen) + n + 1;
250 total = strnlen(dest, destlen) + strnlen(src, destlen) + 1;
  • 140 size_t __mbrlen(const char *restrict s, size_t n, mbstate_t *restrict st) {
    141 return mbrlen(s, n, st);
    149 assert(destlen >= n);
    150
    151 return wcsncpy(dest, src, n);
    152 }
    153
    154 wchar_t *__wcscat_chk(wchar_t *dest, const wchar_t *src, size_t n)
    155 {
    156 wchar_t *a = dest;
    157 size_t destlen = wcslen(dest);
    158 assert(destlen + wcslen(src) + 1 <= n);
    159
    160 dest += destlen;
    161 while (n && *src) {
    162 n--;
  • Overall, this is a good change. Thank you!

    See inline comments for a few small nits before merge.

  • Lassebq marked this merge request as ready

    marked this merge request as ready

  • Anna Wilcox added 6 commits

    added 6 commits

    Compare with previous version

  • merged

  • Please register or sign in to reply
    Loading