Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[darwin][disk][host] Move C dependencies to satisfy go mod and have descriptive file names #889

Merged
merged 2 commits into from
Jun 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion disk/disk_darwin_cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package disk
#cgo LDFLAGS: -framework CoreFoundation -framework IOKit
#include <stdint.h>
#include <CoreFoundation/CoreFoundation.h>
#include "disk_darwin.h"
#include "iostat_darwin.h"
*/
import "C"

Expand Down
2 changes: 1 addition & 1 deletion disk/disk_darwin.c → disk/iostat_darwin.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// https://github.com/lufia/iostat/blob/9f7362b77ad333b26c01c99de52a11bdb650ded2/iostat_darwin.c
#include <stdint.h>
#include <CoreFoundation/CoreFoundation.h>
#include "disk_darwin.h"
#include "iostat_darwin.h"

#define IOKIT 1 /* to get io_name_t in device_types.h */

Expand Down
File renamed without changes.
4 changes: 1 addition & 3 deletions host/host_darwin_cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
package host

// #cgo LDFLAGS: -framework IOKit
// #include <stdio.h>
// #include <string.h>
// #include "include/smc.c"
// #include "smc_darwin.h"
import "C"
import "context"

Expand Down
4 changes: 3 additions & 1 deletion host/include/smc.c → host/smc_darwin.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "smc.h"
#include <stdio.h>
#include <string.h>
#include "smc_darwin.h"

#define IOSERVICE_SMC "AppleSMC"
#define IOSERVICE_MODEL "IOPlatformExpertDevice"
Expand Down
File renamed without changes.