mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
libkirk: let C++ callers include its headers directly
kirk_engine.h and amctrl.h guard their declarations, but AES.h and SHA1.h never did, and kirk_engine.h includes them from outside its own guard. So the AES_* and SHA1* functions got C++ linkage in any C++ file that reached them through there, and only linked for callers that happened to wrap the whole header in an extern "C" of their own. Nothing had called AES_* from C++ before, so it stayed hidden until something did. Guarding the two headers instead lets every caller include them plainly, and the wrappers scattered around the tree come out. Both are pure declarations over kirk_common.h's typedefs with no system headers behind them, so there's nothing in there that shouldn't be wrapped. kirk_engine.h also uses size_t without including anything that defines it, which only held together because its includers happened to have it already. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
1 parent
19723f59eb
commit
f9bd5682db
10 files changed
+22
-21
No files matched your search
@@ -3,6 +3,10 @@
|
||||
|
||||
#include "kirk_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define AES_KEY_LEN_128 (128)
|
||||
#define AES_KEY_LEN_192 (192)
|
||||
#define AES_KEY_LEN_256 (256)
|
||||
@@ -48,4 +52,8 @@ int rijndaelKeySetupEnc(u32 [], const u8 [], int);
|
||||
int rijndaelKeySetupDec(u32 [], const u8 [], int);
|
||||
void rijndaelEncrypt(const u32 [], int, const u8 pt[16], u8 ct[16]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __RIJNDAEL_H */
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
#include "kirk_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* POINTER defines a generic pointer type */
|
||||
typedef unsigned char *POINTER;
|
||||
typedef const unsigned char *CONST_POINTER;
|
||||
@@ -34,3 +38,7 @@ void SHAUpdate(SHA_CTX *, const BYTE *buffer, int count);
|
||||
void SHAFinal(BYTE *output, SHA_CTX *);
|
||||
|
||||
void endianTest(int *endianness);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -26,6 +26,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// kirk4()/kirk7() below take a size_t, and nothing here provided it - the header only ever
|
||||
// compiled because whatever included it had pulled in a definition first. Core/HLE/scePspNpDrm_user.cpp
|
||||
// includes libkirk before anything else, so it doesn't.
|
||||
#include <stddef.h>
|
||||
|
||||
#include "kirk_common.h"
|
||||
#include "SHA1.h"
|
||||
#include "AES.h"
|
||||
|
||||
Reference in new issue
Block a user