Skip to content

Commit

Permalink
Fix build error on Mac when spin_no_std is enabled by dependents of l…
Browse files Browse the repository at this point in the history
…azy_static. (linebender#2211)
  • Loading branch information
Steve-xmh committed Jul 1, 2022
1 parent bc1877b commit c0b631a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions druid-shell/src/backend/mac/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ impl DelegateState {

struct AppDelegate(*const Class);
unsafe impl Sync for AppDelegate {}
unsafe impl Send for AppDelegate {}

lazy_static! {
static ref APP_DELEGATE: AppDelegate = unsafe {
Expand Down
2 changes: 2 additions & 0 deletions druid-shell/src/backend/mac/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ impl WindowBuilder {
// Wrap pointer because lazy_static requires Sync.
struct ViewClass(*const Class);
unsafe impl Sync for ViewClass {}
unsafe impl Send for ViewClass {}

lazy_static! {
static ref VIEW_CLASS: ViewClass = unsafe {
Expand Down Expand Up @@ -583,6 +584,7 @@ fn make_view(handler: Box<dyn WinHandler>) -> (id, Weak<Mutex<Vec<IdleKind>>>) {

struct WindowClass(*const Class);
unsafe impl Sync for WindowClass {}
unsafe impl Send for WindowClass {}

lazy_static! {
static ref WINDOW_CLASS: WindowClass = unsafe {
Expand Down

0 comments on commit c0b631a

Please sign in to comment.