Files
AnyPS5/core/libs/tests/GuestCharacter.cpp
T
devilismyfriendandClaude Opus 5.5 a503d0b617 Merge remote-tracking branch 'origin/main' into feat/demons-souls-boot
Brings in main up to 9958d26 (homebrew runtime, POSIX wrappers in
libkernel, sce_module guest modules and --skip-sce-module, the --to-intel
general pipeline, libSceRandom, libSceRtc, libScePosixForWebKit,
libRenoirCore, test wiring).

Resolutions where both sides implemented the same thing:
- libkernel pthread: main's structure (lazy static initialisation,
  destroyed markers, MutexOperations/CondOperations, mutex protocol and
  condattr clock) with this branch's TimedWait deadlines and condition
  (precise timed lock/wait on Windows), wait tracing, the adaptive mutex
  type 4, POSIX default ERRORCHECK mutexes, EDEADLK/EPERM results instead
  of throws, and condition clocks honoured for absolute timeouts.
- libc locale: the guest Dinkumware ABI (_Locimp, facet vtables, short
  ctype/case tables, locale ids, stream storage) is kept because guest code
  inlines those layouts; main's C character functions are kept on top.
- libc stdio/strings/math: main's stream functions (guest FILE status
  sync), strerror/perror, remove, formatting, string and math exports win
  over this branch's duplicates.
- libc paths: main's working directory with this branch's path aliases
  resolved on the normalised guest path.
- libkernel file: this branch's sceKernel* results as SCE errors, main's
  POSIX wrappers and both fstat helpers.
- relinker: this branch's stub lowering keeps its trampolines through the
  main executable path; guest modules refuse lowerings that need stubs.
- AGC driver: main's rendering wait is executed by this branch's workers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177gthrWEBBfBu5xJDXgBfo
2026-09-27 10:52:21 -07:00

46 lines
2.1 KiB
C++

#include "prx/libc/include/general/VabiMacros.hpp"
#include <cctype>
#include <clocale>
#include <cstdio>
#include <cstdlib>
extern "C" {
int APS5_VABI isupper_nid_postfix(int);
int APS5_VABI islower_nid_postfix(int);
int APS5_VABI isalpha_nid_postfix(int);
int APS5_VABI isdigit_nid_postfix(int);
int APS5_VABI isalnum_nid_postfix(int);
int APS5_VABI isspace_nid_postfix(int);
int APS5_VABI isblank_nid_postfix(int);
int APS5_VABI iscntrl_nid_postfix(int);
int APS5_VABI isprint_nid_postfix(int);
int APS5_VABI isgraph_nid_postfix(int);
int APS5_VABI ispunct_nid_postfix(int);
int APS5_VABI isxdigit_nid_postfix(int);
int APS5_VABI toupper_nid_postfix(int);
int APS5_VABI tolower_nid_postfix(int);
const short* APS5_VABI _Getptolower_nid_postfix();
const short* APS5_VABI _Getptoupper_nid_postfix();
}
static void Require(bool value) { if (!value) std::abort(); }
int main() {
Require(std::setlocale(LC_CTYPE, "C") != nullptr);
for (int c = EOF; c <= 255; ++c) {
Require(bool(isupper_nid_postfix(c)) == bool(std::isupper(c)));
Require(bool(islower_nid_postfix(c)) == bool(std::islower(c)));
Require(bool(isalpha_nid_postfix(c)) == bool(std::isalpha(c)));
Require(bool(isdigit_nid_postfix(c)) == bool(std::isdigit(c)));
Require(bool(isalnum_nid_postfix(c)) == bool(std::isalnum(c)));
Require(bool(isspace_nid_postfix(c)) == bool(std::isspace(c)));
Require(bool(isblank_nid_postfix(c)) == bool(std::isblank(c)));
Require(bool(iscntrl_nid_postfix(c)) == bool(std::iscntrl(c)));
Require(bool(isprint_nid_postfix(c)) == bool(std::isprint(c)));
Require(bool(isgraph_nid_postfix(c)) == bool(std::isgraph(c)));
Require(bool(ispunct_nid_postfix(c)) == bool(std::ispunct(c)));
Require(bool(isxdigit_nid_postfix(c)) == bool(std::isxdigit(c)));
Require(toupper_nid_postfix(c) == std::toupper(c));
Require(tolower_nid_postfix(c) == std::tolower(c));
Require(toupper_nid_postfix(c) == _Getptoupper_nid_postfix()[c]);
Require(tolower_nid_postfix(c) == _Getptolower_nid_postfix()[c]);
}
}