Skip to content

Commit

Permalink
Merge pull request #441 from doesthisusername/restrict-fix
Browse files Browse the repository at this point in the history
Add fallback for the restrict keyword being unavailable to bind_gen
  • Loading branch information
CryZe authored Aug 18, 2021
2 parents cc782a3 + c879992 commit 85c6b4d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion capi/bind_gen/src/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,16 @@ pub fn write<W: Write>(mut writer: W, classes: &BTreeMap<String, Class>) -> Resu
r#"#ifndef LIVESPLIT_CORE_H
#define LIVESPLIT_CORE_H
#ifdef __cplusplus
/**
Most C/C++ compilers support __restrict, and it's been standardized in C99 by
adding the restrict keyword.
If not compiled in C99 (or higher) modes, try to use __restrict instead.
*/
#if __STDC_VERSION__ < 199901L
#define restrict __restrict
#endif
#ifdef __cplusplus
namespace LiveSplit {
extern "C" {
#endif
Expand Down

0 comments on commit 85c6b4d

Please sign in to comment.