Mercurial > minori
comparison dep/animia/src/util/osx.cc @ 237:a7d0d543b334
*: make OS X builds succeed
new script: deploy_build.sh, creates the app bundle
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Fri, 19 Jan 2024 11:14:44 -0500 |
parents | 8548dc425697 |
children |
comparison
equal
deleted
inserted
replaced
236:4d461ef7d424 | 237:a7d0d543b334 |
---|---|
6 #include <sys/sysctl.h> | 6 #include <sys/sysctl.h> |
7 #include <libproc.h> | 7 #include <libproc.h> |
8 | 8 |
9 namespace animia::internal::osx::util { | 9 namespace animia::internal::osx::util { |
10 | 10 |
11 #ifdef HAVE_COREFOUNDATION | |
12 /* all of these LaunchServices things use *internal functions* that are subject | 11 /* all of these LaunchServices things use *internal functions* that are subject |
13 * to change. Granted, it's not very likely that these will change very much | 12 * to change. Granted, it's not very likely that these will change very much |
14 * because I'm fairly sure Apple uses them lots in their own internal code. | 13 * because I'm fairly sure Apple uses them lots in their own internal code. |
15 */ | 14 */ |
16 typedef CFTypeRef (*LSASNCreateWithPidSpec)(CFAllocatorRef, pid_t); | 15 typedef CFTypeRef (*LSASNCreateWithPidSpec)(CFAllocatorRef, pid_t); |
102 if (!CFStringGetCString(string, &result.front(), result.length(), kCFStringEncodingUTF8)) | 101 if (!CFStringGetCString(string, &result.front(), result.length(), kCFStringEncodingUTF8)) |
103 return false; | 102 return false; |
104 | 103 |
105 return true; | 104 return true; |
106 } | 105 } |
107 #endif // HAVE_COREFOUNDATION | |
108 | 106 |
109 static bool GetProcessArgs(pid_t pid, std::string& args) { | 107 static bool GetProcessArgs(pid_t pid, std::string& args) { |
110 /* sysctl shouldn't touch these, so we define them as const */ | 108 /* sysctl shouldn't touch these, so we define them as const */ |
111 const int mib[3] = {CTL_KERN, KERN_PROCARGS2, static_cast<int>(pid)}; | 109 const int mib[3] = {CTL_KERN, KERN_PROCARGS2, static_cast<int>(pid)}; |
112 const size_t mib_size = sizeof(mib)/sizeof(*mib); | 110 const size_t mib_size = sizeof(mib)/sizeof(*mib); |