Skip to content

Commit

Permalink
fix: Move headers out of Extern C (#3690)
Browse files Browse the repository at this point in the history
If a project uses a C++ compiler, it will not compile because of some headers inside a "extern C" block referencing C++ code.

This appears to be an inheritance from KSCrash that I don't fully understand the reasoning behind. Moving these headers out of the extern block hasn't caused any crashes in our default pipeline, so I believe we're fine with it.
  • Loading branch information
brustolin authored Mar 1, 2024
1 parent 61a1a2b commit a71f5e2
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Make SentryFramesTracker available for HybridSDKs ([#3683](https://github.com/getsentry/sentry-cocoa/pull/3683))
- Make SentrySwizzle available for HybridSDKs ([#3684](https://github.com/getsentry/sentry-cocoa/pull/3684))
- Move headers reference out of "extern C" (#3690)

## 8.21.0-beta.0

Expand Down
8 changes: 4 additions & 4 deletions Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
#ifndef HDR_SentryCrashMonitor_h
#define HDR_SentryCrashMonitor_h

#ifdef __cplusplus
extern "C" {
#endif

#include "SentryCrashMonitorType.h"
#include "SentryCrashThread.h"

#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

struct SentryCrash_MonitorContext;

// ============================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
#ifndef HDR_SentryCrashMonitor_CPPException_h
#define HDR_SentryCrashMonitor_CPPException_h

#include "SentryCrashMonitor.h"

#ifdef __cplusplus
extern "C" {
#endif

#include "SentryCrashMonitor.h"

/** Access the Monitor API.
*/
SentryCrashMonitorAPI *sentrycrashcm_cppexception_getAPI(void);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
#ifndef SentryCrashStackCursor_Backtrace_h
#define SentryCrashStackCursor_Backtrace_h

#import "SentryCrashStackCursor.h"

#ifdef __cplusplus
extern "C" {
#endif

#include "SentryCrashStackCursor.h"

/** Exposed for other internal systems to use.
*/
typedef struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
#ifndef SentryCrashStackCursor_MachineContext_h
#define SentryCrashStackCursor_MachineContext_h

#import "SentryCrashStackCursor.h"

#ifdef __cplusplus
extern "C" {
#endif

#include "SentryCrashStackCursor.h"

#define MAX_STACKTRACE_LENGTH 100

/** Initialize a stack cursor for a machine context.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
#ifndef SentryCrashStackCursor_SelfThread_h
#define SentryCrashStackCursor_SelfThread_h

#import "SentryCrashStackCursor.h"

#ifdef __cplusplus
extern "C" {
#endif

#include "SentryCrashStackCursor.h"

/** Initialize a stack cursor for the current thread.
* You may want to skip some entries to account for the trace immediately
* leading up to this init function.
Expand Down
6 changes: 3 additions & 3 deletions Sources/SentryCrash/Recording/Tools/SentryCrashSymbolicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
#ifndef SentryCrashSymbolicator_h
#define SentryCrashSymbolicator_h

#import "SentryCrashStackCursor.h"
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

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

/** Symbolicate a stack cursor.
*
* @param cursor The cursor to symbolicate.
Expand Down

0 comments on commit a71f5e2

Please sign in to comment.