Skip to content

Commit

Permalink
Make string invalid UTF-8 again.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Feb 21, 2024
1 parent f78f544 commit 0600260
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bindgen-integration/build.rs
Expand Up @@ -95,7 +95,7 @@ impl ParseCallbacks for MacroCallback {
}
"TESTMACRO_STRING_FUNC_NON_UTF8" => {
assert_eq!(args, &["x"]);
assert_eq!(body, &["(", "x", "\"ÿÿ\"", ")"]);
assert_eq!(body, &["(", "x", r#""\xFF\xFF""#, ")"]);
*self.seen_funcs.lock().unwrap() += 1;
}
name => {
Expand Down
2 changes: 1 addition & 1 deletion bindgen-integration/cpp/Test.h
Expand Up @@ -20,7 +20,7 @@
a
//#define TESTMACRO_INVALID("string") // A conforming preprocessor rejects this
#define TESTMACRO_STRING_EXPR ("string")
#define TESTMACRO_STRING_FUNC_NON_UTF8(x) (x "ÿÿ") /* invalid UTF-8 on purpose */
#define TESTMACRO_STRING_FUNC_NON_UTF8(x) (x "\xFF\xFF") /* invalid UTF-8 on purpose */

enum {
MY_ANNOYING_MACRO =
Expand Down

0 comments on commit 0600260

Please sign in to comment.