Skip to content

Commit

Permalink
Wrap headers with extern "C" in C++ mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
getreuer committed Apr 21, 2022
1 parent 87eb4e5 commit 47af628
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 0 deletions.
8 changes: 8 additions & 0 deletions features/autocorrection.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,13 @@

#include "quantum.h"

#ifdef __cplusplus
extern "C" {
#endif

bool process_autocorrection(uint16_t keycode, keyrecord_t* record);

#ifdef __cplusplus
}
#endif

8 changes: 8 additions & 0 deletions features/caps_word.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@

#include "quantum.h"

#ifdef __cplusplus
extern "C" {
#endif

// Call this function from `process_record_user()` to implement Caps Word.
bool process_caps_word(uint16_t keycode, keyrecord_t* record);

Expand Down Expand Up @@ -126,3 +130,7 @@ void caps_word_set_user(bool active);
// deactivate Caps Word.
bool caps_word_press_user(uint16_t keycode);

#ifdef __cplusplus
}
#endif

8 changes: 8 additions & 0 deletions features/custom_shift_keys.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@

#include "quantum.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
uint16_t keycode;
uint16_t shifted_keycode;
Expand All @@ -64,3 +68,7 @@ extern uint8_t NUM_CUSTOM_SHIFT_KEYS;

bool process_custom_shift_keys(uint16_t keycode, keyrecord_t *record);

#ifdef __cplusplus
}
#endif

8 changes: 8 additions & 0 deletions features/layer_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@

#include "quantum.h"

#ifdef __cplusplus
extern "C" {
#endif

// In your keymap, define a custom keycode to use for Layer Lock. Then handle
// Layer Lock from your `process_record_user` function by calling
// `process_layer_lock`, passing your custom keycode for the `lock_keycode` arg:
Expand Down Expand Up @@ -78,3 +82,7 @@ void layer_lock_invert(uint8_t layer);
// }
void layer_lock_set_user(layer_state_t locked_layers);

#ifdef __cplusplus
}
#endif

8 changes: 8 additions & 0 deletions features/mouse_turbo_click.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@

#include "quantum.h"

#ifdef __cplusplus
extern "C" {
#endif

// In your keymap, define a custom keycode to use for Turbo Click. Then handle
// Turbo Click from your `process_record_user` function by calling
// `process_mouse_turbo_click`, passing your custom keycode for the
Expand All @@ -51,3 +55,7 @@
bool process_mouse_turbo_click(uint16_t keycode, keyrecord_t* record,
uint16_t turbo_click_keycode);

#ifdef __cplusplus
}
#endif

8 changes: 8 additions & 0 deletions features/select_word.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@

#include "quantum.h"

#ifdef __cplusplus
extern "C" {
#endif

bool process_select_word(uint16_t keycode, keyrecord_t* record,
uint16_t sel_keycode);

#ifdef __cplusplus
}
#endif

0 comments on commit 47af628

Please sign in to comment.