Skip to content

Commit

Permalink
Make the presence of compiler-generated padding an error during build.
Browse files Browse the repository at this point in the history
  • Loading branch information
juj committed Aug 29, 2022
1 parent 4bbaaf9 commit 3345174
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/lib_webgpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#include <emscripten/html5.h>
#include <stdint.h>

// The internal struct member offset layout is extremely important when marshalling structs to JS,
// so never let the compiler add any padding (we manually & explicitly make the fields the right size)
#pragma clang diagnostic error "-Wpadded"

#include "lib_webgpu_fwd.h"

// Some WebGPU JS API functions have default parameters so that the user can omit passing them.
Expand Down

0 comments on commit 3345174

Please sign in to comment.