mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-05 13:20:11 +00:00
Release builds fold a declared function's address compared with nullptr to false, so the tables' loops compiled away together with the tables' references to the exports, and the checks passed without the library exporting anything. Each test now gets its library's built file from its add_test line, opens it, looks up every name in its table, and requires one name the library doesn't export not to resolve. The table entries are read through a volatile copy, so the test binaries keep importing them.
20 lines
640 B
C++
20 lines
640 B
C++
#include "prx/libSceAvPlayer.native/include/Api.hpp"
|
|
#include "SceTypes.hpp"
|
|
#include "prx/libc/include/general/VabiMacros.hpp"
|
|
#include "tests/ExportLookup.hpp"
|
|
#include <cstdio>
|
|
|
|
int main(int argc, char** argv) {
|
|
struct Export {
|
|
int (APS5_VABI* function)(void);
|
|
const char* name;
|
|
};
|
|
const Export exports[] = {
|
|
{sceAvPlayerPrintf, "sceAvPlayerPrintf"},
|
|
{sceAvPlayerVprintf, "sceAvPlayerVprintf"},
|
|
};
|
|
if (!ExportsResolveByName(argc > 1 ? argv[1] : nullptr, exports, "sceAvPlayerNotExported")) return 1;
|
|
std::puts("libSceAvPlayer.native pending exports are exported");
|
|
return 0;
|
|
}
|