Skip to content

Commit

Permalink
Fix placement of "extern "C"" directive
Browse files Browse the repository at this point in the history
  • Loading branch information
bamx23 committed May 5, 2024
1 parent 8bf0f6d commit 93f8651
Show file tree
Hide file tree
Showing 38 changed files with 107 additions and 151 deletions.
7 changes: 3 additions & 4 deletions Sources/KSCrashRecording/KSCrashReport.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,14 @@
#ifndef HDR_KSCrashReport_h
#define HDR_KSCrashReport_h

#ifdef __cplusplus
extern "C" {
#endif

#import "KSCrashReportWriter.h"
#import "KSCrashMonitorContext.h"

#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

// ============================================================================
#pragma mark - Configuration -
Expand Down
5 changes: 2 additions & 3 deletions Sources/KSCrashRecording/KSCrashReportStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@
#ifndef HDR_KSCrashReportStore_h
#define HDR_KSCrashReportStore_h

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif


#include <stdint.h>

#define KSCRS_MAX_PATH_LENGTH 500

/** Initialize the report store.
Expand Down
9 changes: 4 additions & 5 deletions Sources/KSCrashRecording/Monitors/KSCrashMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,15 @@
#ifndef HDR_KSCrashMonitor_h
#define HDR_KSCrashMonitor_h

#ifdef __cplusplus
extern "C" {
#endif


#include "KSCrashMonitorType.h"
#include "KSThread.h"

#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

struct KSCrash_MonitorContext;


Expand Down
8 changes: 4 additions & 4 deletions Sources/KSCrashRecording/Monitors/KSCrashMonitorContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@
#ifndef HDR_KSCrashMonitorContext_h
#define HDR_KSCrashMonitorContext_h

#ifdef __cplusplus
extern "C" {
#endif

#include "KSCrashMonitorType.h"
#include "KSMachineContext.h"

#include <stdbool.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct KSCrash_MonitorContext
{
/** Unique identifier for this event. */
Expand Down
7 changes: 3 additions & 4 deletions Sources/KSCrashRecording/Monitors/KSCrashMonitor_AppState.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@
#ifndef HDR_KSCrashMonitor_AppState_h
#define HDR_KSCrashMonitor_AppState_h

#ifdef __cplusplus
extern "C" {
#endif

#include "KSCrashMonitor.h"

#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
#ifndef HDR_KSCrashMonitor_CPPException_h
#define HDR_KSCrashMonitor_CPPException_h

#include "KSCrashMonitor.h"

#ifdef __cplusplus
extern "C" {
#endif

#include "KSCrashMonitor.h"

/** Enable swapping of __cxa_trow symbol with lazy symbols table
*/
void kscm_enableSwapCxaThrow(void);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
#ifndef HDR_KSCrashMonitor_MachException_h
#define HDR_KSCrashMonitor_MachException_h

#include "KSCrashMonitor.h"
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

#include "KSCrashMonitor.h"
#include <stdbool.h>


/** Access the Monitor API.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@
#ifndef HDR_KSCrashMonitor_NSException_h
#define HDR_KSCrashMonitor_NSException_h

#include "KSCrashMonitor.h"

#ifdef __cplusplus
extern "C" {
#endif


#include "KSCrashMonitor.h"


/** Access the Monitor API.
*/
KSCrashMonitorAPI* kscm_nsexception_getAPI(void);
Expand Down
5 changes: 2 additions & 3 deletions Sources/KSCrashRecording/Monitors/KSCrashMonitor_Signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@
#ifndef HDR_KSCrashMonitor_Signal_h
#define HDR_KSCrashMonitor_Signal_h

#include "KSCrashMonitor.h"

#ifdef __cplusplus
extern "C" {
#endif


#include "KSCrashMonitor.h"


/** Access the Monitor API.
*/
KSCrashMonitorAPI* kscm_signal_getAPI(void);
Expand Down
5 changes: 2 additions & 3 deletions Sources/KSCrashRecording/Monitors/KSCrashMonitor_System.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@
#ifndef KSCrashMonitor_System_h
#define KSCrashMonitor_System_h

#include "KSCrashMonitor.h"

#ifdef __cplusplus
extern "C" {
#endif


#include "KSCrashMonitor.h"


/** Access the Monitor API.
*/
KSCrashMonitorAPI* kscm_system_getAPI(void);
Expand Down
9 changes: 4 additions & 5 deletions Sources/KSCrashRecording/Monitors/KSCrashMonitor_User.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@
#ifndef HDR_KSCrashMonitor_User_h
#define HDR_KSCrashMonitor_User_h

#ifdef __cplusplus
extern "C" {
#endif


#include "KSCrashMonitor.h"

#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif


/** Report a custom, user defined exception.
* If terminateProgram is true, all sentries will be uninstalled and the application will
Expand Down
7 changes: 3 additions & 4 deletions Sources/KSCrashRecording/Monitors/KSCrashMonitor_Zombie.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,12 @@
#ifndef HDR_KSZombie_h
#define HDR_KSZombie_h

#ifdef __cplusplus
extern "C" {
#endif

#include "KSCrashMonitor.h"
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

/** Get the class of a deallocated object pointer, if it was tracked.
*
Expand Down
8 changes: 3 additions & 5 deletions Sources/KSCrashRecording/include/KSCrashC.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,14 @@
#ifndef HDR_KSCrashC_h
#define HDR_KSCrashC_h

#ifdef __cplusplus
extern "C" {
#endif


#include "KSCrashMonitorType.h"
#include "KSCrashReportWriter.h"

#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

/** Install the crash reporter. The reporter will record the next crash and then
* terminate the program.
Expand Down
8 changes: 3 additions & 5 deletions Sources/KSCrashRecording/include/KSCrashReportWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,12 @@
#ifndef HDR_KSCrashReportWriter_h
#define HDR_KSCrashReportWriter_h

#ifdef __cplusplus
extern "C" {
#endif


#include <stdbool.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
* Encapsulates report writing functionality.
Expand Down
9 changes: 4 additions & 5 deletions Sources/KSCrashRecordingCore/include/KSCPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,15 @@
#ifndef HDR_KSCPU_h
#define HDR_KSCPU_h

#ifdef __cplusplus
extern "C" {
#endif


#include "KSMachineContext.h"

#include <stdbool.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

/** Get the current CPU architecture.
*
* @return The current architecture.
Expand Down
5 changes: 2 additions & 3 deletions Sources/KSCrashRecordingCore/include/KSCPU_Apple.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@
#ifndef HDR_KSCPU_Apple_h
#define HDR_KSCPU_Apple_h

#include <mach/mach_types.h>

#ifdef __cplusplus
extern "C" {
#endif


#include <mach/mach_types.h>

/** Fill in state information about a thread.
*
* @param thread The thread to get information about.
Expand Down
5 changes: 2 additions & 3 deletions Sources/KSCrashRecordingCore/include/KSDate.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@
#ifndef KSDate_h
#define KSDate_h

#include <sys/types.h>

#ifdef __cplusplus
extern "C" {
#endif


#include <sys/types.h>

/** Convert a UNIX timestamp to an RFC3339 string representation.
*
* @param timestamp The date to convert.
Expand Down
6 changes: 2 additions & 4 deletions Sources/KSCrashRecordingCore/include/KSDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@

#ifndef HDR_KSDebug_h
#define HDR_KSDebug_h

#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif


#include <stdbool.h>


/** Check if the current process is being traced or not.
*
* @return true if we're being traced.
Expand Down
9 changes: 4 additions & 5 deletions Sources/KSCrashRecordingCore/include/KSDynamicLinker.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@
#ifndef HDR_KSDynamicLinker_h
#define HDR_KSDynamicLinker_h

#ifdef __cplusplus
extern "C" {
#endif


#include <dlfcn.h>
#include <stdbool.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct
{
uint64_t address;
Expand Down
8 changes: 3 additions & 5 deletions Sources/KSCrashRecordingCore/include/KSFileUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@
#ifndef HDR_KSFileUtils_h
#define HDR_KSFileUtils_h

#ifdef __cplusplus
extern "C" {
#endif


#include <stdbool.h>
#include <stdarg.h>

#ifdef __cplusplus
extern "C" {
#endif

#define KSFU_MAX_PATH_LENGTH 500

Expand Down
7 changes: 3 additions & 4 deletions Sources/KSCrashRecordingCore/include/KSJSONCodec.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@
#ifndef HDR_KSJSONCodec_h
#define HDR_KSJSONCodec_h

#include <stdbool.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif


#include <stdbool.h>
#include <stdint.h>

/* Tells the encoder to automatically determine the length of a field value.
* Currently, this is done using strlen().
*/
Expand Down
6 changes: 2 additions & 4 deletions Sources/KSCrashRecordingCore/include/KSLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,12 @@
#ifndef HDR_KSLogger_h
#define HDR_KSLogger_h

#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif


#include <stdbool.h>


#ifdef __OBJC__

#import <CoreFoundation/CoreFoundation.h>
Expand Down
Loading

0 comments on commit 93f8651

Please sign in to comment.