1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-22 18:26:39 +00:00

Fix linkage for C++ projects (#79)

This commit is contained in:
MasaGratoR 2021-03-23 15:06:52 +01:00 committed by GitHub
parent e9a9a5abcc
commit e0949bba6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 233 additions and 1 deletions

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __AES_H__ #ifndef __AES_H__
#define __AES_H__ #define __AES_H__
@ -81,3 +85,7 @@ NX_INLINE void aes128CtrUpdatePartialCtrEx(u8 *ctr, u32 ctr_val, u64 offset)
} }
#endif /* __AES_H__ */ #endif /* __AES_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -21,6 +21,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __BFTTF_H__ #ifndef __BFTTF_H__
#define __BFTTF_H__ #define __BFTTF_H__
@ -53,3 +57,7 @@ void bfttfExit(void);
bool bfttfGetFontByType(BfttfFontData *font, u8 font_type); bool bfttfGetFontByType(BfttfFontData *font, u8 font_type);
#endif /* __BFTTF_H__ */ #endif /* __BFTTF_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -21,6 +21,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __BKTR_H__ #ifndef __BKTR_H__
#define __BKTR_H__ #define __BKTR_H__
@ -154,3 +158,7 @@ NX_INLINE bool bktrGeneratePathFromFileEntry(BktrContext *ctx, RomFileSystemFile
} }
#endif /* __BKTR_H__ */ #endif /* __BKTR_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __CERT_H__ #ifndef __CERT_H__
#define __CERT_H__ #define __CERT_H__
@ -241,3 +245,7 @@ NX_INLINE u64 certGetSignedCertificateHashAreaSize(void *buf)
} }
#endif /* __CERT_H__ */ #endif /* __CERT_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __CNMT_H__ #ifndef __CNMT_H__
#define __CNMT_H__ #define __CNMT_H__
@ -290,3 +294,7 @@ NX_INLINE u32 cnmtGetRequiredTitleVersion(ContentMetaContext *cnmt_ctx)
} }
#endif /* __CNMT_H__ */ #endif /* __CNMT_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -23,6 +23,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __CRC32_FAST_H__ #ifndef __CRC32_FAST_H__
#define __CRC32_FAST_H__ #define __CRC32_FAST_H__
@ -31,3 +35,7 @@
void crc32FastCalculate(const void *data, u64 n_bytes, u32 *crc); void crc32FastCalculate(const void *data, u64 n_bytes, u32 *crc);
#endif /* __CRC32_FAST_H__ */ #endif /* __CRC32_FAST_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -21,6 +21,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __ES_H__ #ifndef __ES_H__
#define __ES_H__ #define __ES_H__
@ -33,3 +37,7 @@ Result esListCommonTicket(s32 *out_entries_written, FsRightsId *out_ids, s32 cou
Result esListPersonalizedTicket(s32 *out_entries_written, FsRightsId *out_ids, s32 count); Result esListPersonalizedTicket(s32 *out_entries_written, FsRightsId *out_ids, s32 count);
#endif /* __ES_H__ */ #endif /* __ES_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __FS_EXT_H__ #ifndef __FS_EXT_H__
#define __FS_EXT_H__ #define __FS_EXT_H__
@ -46,3 +50,7 @@ Result fsDeviceOperatorUpdatePartitionInfo(FsDeviceOperator *d, const FsGameCard
Result fsDeviceOperatorGetGameCardDeviceCertificate(FsDeviceOperator *d, const FsGameCardHandle *handle, FsGameCardCertificate *out); Result fsDeviceOperatorGetGameCardDeviceCertificate(FsDeviceOperator *d, const FsGameCardHandle *handle, FsGameCardCertificate *out);
#endif /* __FS_EXT_H__ */ #endif /* __FS_EXT_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __GAMECARD_H__ #ifndef __GAMECARD_H__
#define __GAMECARD_H__ #define __GAMECARD_H__
@ -235,3 +239,7 @@ bool gamecardGetHashFileSystemContext(u8 hfs_partition_type, HashFileSystemConte
bool gamecardGetHashFileSystemEntryInfoByName(u8 hfs_partition_type, const char *entry_name, u64 *out_offset, u64 *out_size); bool gamecardGetHashFileSystemEntryInfoByName(u8 hfs_partition_type, const char *entry_name, u64 *out_offset, u64 *out_size);
#endif /* __GAMECARD_H__ */ #endif /* __GAMECARD_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __HFS_H__ #ifndef __HFS_H__
#define __HFS_H__ #define __HFS_H__
@ -118,3 +122,7 @@ NX_INLINE HashFileSystemEntry *hfsGetEntryByName(HashFileSystemContext *ctx, con
} }
#endif /* __HFS_H__ */ #endif /* __HFS_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -22,6 +22,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __KEYS_H__ #ifndef __KEYS_H__
#define __KEYS_H__ #define __KEYS_H__
@ -34,3 +38,7 @@ const u8 *keysGetTitlekek(u8 key_generation);
const u8 *keysGetKeyAreaEncryptionKey(u8 key_generation, u8 kaek_index); const u8 *keysGetKeyAreaEncryptionKey(u8 key_generation, u8 kaek_index);
#endif /* __KEYS_H__ */ #endif /* __KEYS_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __LEGAL_INFO_H__ #ifndef __LEGAL_INFO_H__
#define __LEGAL_INFO_H__ #define __LEGAL_INFO_H__
@ -44,3 +48,7 @@ NX_INLINE void legalInfoFreeContext(LegalInfoContext *legal_info_ctx)
} }
#endif /* __LEGAL_INFO_H__ */ #endif /* __LEGAL_INFO_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __LOG_H__ #ifndef __LOG_H__
#define __LOG_H__ #define __LOG_H__
@ -55,3 +59,7 @@ void logGetLastMessage(char *dst, size_t dst_size);
void logControlMutex(bool lock); void logControlMutex(bool lock);
#endif /* __LOG_H__ */ #endif /* __LOG_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -21,6 +21,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __MEM_H__ #ifndef __MEM_H__
#define __MEM_H__ #define __MEM_H__
@ -56,3 +60,7 @@ NX_INLINE void memFreeMemoryLocation(MemoryLocation *location)
} }
#endif /* __MEM_H__ */ #endif /* __MEM_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __NACP_H__ #ifndef __NACP_H__
#define __NACP_H__ #define __NACP_H__
@ -452,3 +456,7 @@ NX_INLINE bool nacpIsValidContext(NacpContext *nacp_ctx)
} }
#endif /* __NACP_H__ */ #endif /* __NACP_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __NCA_H__ #ifndef __NCA_H__
#define __NCA_H__ #define __NCA_H__
@ -494,3 +498,7 @@ NX_INLINE void ncaFreeHierarchicalIntegrityPatch(NcaHierarchicalIntegrityPatch *
} }
#endif /* __NCA_H__ */ #endif /* __NCA_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __NPDM_H__ #ifndef __NPDM_H__
#define __NPDM_H__ #define __NPDM_H__
@ -589,3 +593,7 @@ NX_INLINE u32 npdmGetKernelCapabilityDescriptorEntryValue(NpdmKernelCapabilityDe
} }
#endif /* __NPDM_H__ */ #endif /* __NPDM_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __NSO_H__ #ifndef __NSO_H__
#define __NSO_H__ #define __NSO_H__
@ -142,3 +146,7 @@ NX_INLINE void nsoFreeContext(NsoContext *nso_ctx)
} }
#endif /* __NSO_H__ */ #endif /* __NSO_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __PFS_H__ #ifndef __PFS_H__
#define __PFS_H__ #define __PFS_H__
@ -187,3 +191,7 @@ NX_INLINE char *pfsGetEntryNameByIndexFromFileContext(PartitionFileSystemFileCon
} }
#endif /* __PFS_H__ */ #endif /* __PFS_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __PROGRAM_INFO_H__ #ifndef __PROGRAM_INFO_H__
#define __PROGRAM_INFO_H__ #define __PROGRAM_INFO_H__
@ -81,3 +85,7 @@ NX_INLINE void programInfoWriteNcaPatch(ProgramInfoContext *program_info_ctx, vo
} }
#endif /* __PROGRAM_INFO_H__ */ #endif /* __PROGRAM_INFO_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __ROMFS_H__ #ifndef __ROMFS_H__
#define __ROMFS_H__ #define __ROMFS_H__
@ -200,3 +204,7 @@ NX_INLINE void romfsFreeFileEntryPatch(RomFileSystemFileEntryPatch *patch)
} }
#endif /* __ROMFS_H__ */ #endif /* __ROMFS_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -22,6 +22,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __RSA_H__ #ifndef __RSA_H__
#define __RSA_H__ #define __RSA_H__
@ -41,3 +45,7 @@ const u8 *rsa2048GetCustomPublicKey(void);
bool rsa2048OaepDecryptAndVerify(void *dst, size_t dst_size, const void *signature, const void *modulus, const void *exponent, size_t exponent_size, const void *label_hash, size_t *out_size); bool rsa2048OaepDecryptAndVerify(void *dst, size_t dst_size, const void *signature, const void *modulus, const void *exponent, size_t exponent_size, const void *label_hash, size_t *out_size);
#endif /* __RSA_H__ */ #endif /* __RSA_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -21,6 +21,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __SAVE_H__ #ifndef __SAVE_H__
#define __SAVE_H__ #define __SAVE_H__
@ -514,3 +518,7 @@ void save_close_savefile(save_ctx_t *ctx);
bool save_get_fat_storage_from_file_entry_by_path(save_ctx_t *ctx, const char *path, allocation_table_storage_ctx_t *out_fat_storage, u64 *out_file_entry_size); bool save_get_fat_storage_from_file_entry_by_path(save_ctx_t *ctx, const char *path, allocation_table_storage_ctx_t *out_fat_storage, u64 *out_file_entry_size);
#endif /* __SAVE_H__ */ #endif /* __SAVE_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __SERVICES_H__ #ifndef __SERVICES_H__
#define __SERVICES_H__ #define __SERVICES_H__
@ -50,3 +54,7 @@ void servicesChangeHardwareClockRates(u32 cpu_rate, u32 mem_rate);
Result servicesHasService(bool *out, const char *name); Result servicesHasService(bool *out, const char *name);
#endif /* __SERVICES_H__ */ #endif /* __SERVICES_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __TIK_H__ #ifndef __TIK_H__
#define __TIK_H__ #define __TIK_H__
@ -225,3 +229,7 @@ NX_INLINE bool tikIsPersonalizedTicket(Ticket *tik)
} }
#endif /* __TIK_H__ */ #endif /* __TIK_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __TITLE_H__ #ifndef __TITLE_H__
#define __TITLE_H__ #define __TITLE_H__
@ -265,3 +269,7 @@ NX_INLINE u32 titleGetCountFromInfoBlock(TitleInfo *title_info)
} }
#endif /* __TITLE_H__ */ #endif /* __TITLE_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __UMS_H__ #ifndef __UMS_H__
#define __UMS_H__ #define __UMS_H__
@ -39,3 +43,7 @@ bool umsIsDeviceInfoUpdated(void);
UsbHsFsDevice *umsGetDevices(u32 *out_count); UsbHsFsDevice *umsGetDevices(u32 *out_count);
#endif /* __UMS_H__ */ #endif /* __UMS_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -23,6 +23,10 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __USB_H__ #ifndef __USB_H__
#define __USB_H__ #define __USB_H__
@ -70,3 +74,7 @@ NX_INLINE bool usbSendFilePropertiesCommon(u64 file_size, const char *filename)
} }
#endif /* __USB_H__ */ #endif /* __USB_H__ */
#ifdef __cplusplus
}
#endif

View file

@ -25,6 +25,10 @@
#include "common.h" #include "common.h"
#ifdef __cplusplus
extern "C" {
#endif
#define APP_BASE_PATH "sdmc:/switch/" APP_TITLE "/" #define APP_BASE_PATH "sdmc:/switch/" APP_TITLE "/"
#define MEMBER_SIZE(type, member) sizeof(((type*)NULL)->member) #define MEMBER_SIZE(type, member) sizeof(((type*)NULL)->member)
@ -137,4 +141,8 @@ NX_INLINE void utilsSleep(u64 seconds)
if (seconds) svcSleepThread(seconds * (u64)1000000000); if (seconds) svcSleepThread(seconds * (u64)1000000000);
} }
#endif /* __UTILS_H__ */ #ifdef __cplusplus
}
#endif
#endif /* __UTILS_H__ */