mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Fix build on macos the second
This commit is contained in:
+1
-2
@@ -1,7 +1,6 @@
|
||||
#include "sysctl.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
void ffSysctlGetString(const char* propName, FFstrbuf* result)
|
||||
{
|
||||
@@ -35,7 +34,7 @@ int64_t ffSysctlGetInt64(const char* propName, int64_t defaultValue)
|
||||
return result;
|
||||
}
|
||||
|
||||
void* ffSysctlGetData(int* request, int requestLength, size_t* resultLength)
|
||||
void* ffSysctlGetData(int* request, u_int requestLength, size_t* resultLength)
|
||||
{
|
||||
if(sysctl(request, requestLength, NULL, resultLength, NULL, 0) != 0)
|
||||
return NULL;
|
||||
|
||||
+2
-1
@@ -4,10 +4,11 @@
|
||||
#define FF_INCLUDED_common_sysctl
|
||||
|
||||
#include "fastfetch.h"
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
void ffSysctlGetString(const char* propName, FFstrbuf* result);
|
||||
int ffSysctlGetInt(const char* propName, int defaultValue);
|
||||
int64_t ffSysctlGetInt64(const char* propName, int64_t defaultValue);
|
||||
void* ffSysctlGetData(int* request, int requestLength, size_t* resultLength);
|
||||
void* ffSysctlGetData(int* request, u_int requestLength, size_t* resultLength);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "memory.h"
|
||||
#include "common/systcl.h"
|
||||
#include "common/sysctl.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <mach/mach.h>
|
||||
|
||||
@@ -16,7 +16,7 @@ bool ffCfDictGetString(CFDictionaryRef dict, CFStringRef key, FFstrbuf* result)
|
||||
{
|
||||
// CFStringGetCString ensures the buffer is NUL terminated
|
||||
// https://developer.apple.com/documentation/corefoundation/1542721-cfstringgetcstring
|
||||
result->length = strnlen(result->chars, (uint32_t)result->allocated);
|
||||
result->length = (uint32_t) strnlen(result->chars, (uint32_t)result->allocated);
|
||||
}
|
||||
}
|
||||
else if(CFGetTypeID(cf) == CFDataGetTypeID())
|
||||
|
||||
Reference in New Issue
Block a user