Fix build on macos the second

This commit is contained in:
Linus Dierheimer
2022-09-19 21:45:39 +02:00
parent d5846d94ca
commit f3e6d04c8e
4 changed files with 5 additions and 5 deletions
+1 -2
View File
@@ -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
View File
@@ -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 -1
View File
@@ -1,5 +1,5 @@
#include "memory.h"
#include "common/systcl.h"
#include "common/sysctl.h"
#include <string.h>
#include <mach/mach.h>
+1 -1
View File
@@ -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())