Skip to content

Commit

Permalink
fixed current darwin support
Browse files Browse the repository at this point in the history
  • Loading branch information
parvit committed Jun 9, 2024
1 parent c015d56 commit 1bd1c3b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
12 changes: 12 additions & 0 deletions cocoa/dlg.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@

#ifndef DLG_H
#define DLG_H

#ifndef __has_extension
#define __has_extension(x) 0
#endif

#include <objc/NSObjCRuntime.h>
#include <stdlib.h>
#include <sys/syslimits.h>

typedef enum {
MSG_YESNO,
Expand Down Expand Up @@ -39,3 +49,5 @@ DlgResult fileDlg(FileDlgParams*);

void* NSStr(void* buf, int len);
void NSRelease(void* obj);

#endif
6 changes: 6 additions & 0 deletions cocoa/dlg.m
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@

// fix gcc 11+ macos 14+
#ifndef __has_extension
#define __has_extension(x) 0
#endif

#import <Cocoa/Cocoa.h>
#include "dlg.h"

Expand Down
2 changes: 0 additions & 2 deletions cocoa/dlg_darwin.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package cocoa

// #cgo darwin LDFLAGS: -framework Cocoa
// #include <stdlib.h>
// #include <sys/syslimits.h>
// #include "dlg.h"
import "C"

Expand Down

0 comments on commit 1bd1c3b

Please sign in to comment.