From 51213b102296c1e48f25aa9472a8be74a31cb6b7 Mon Sep 17 00:00:00 2001 From: Jan Willamowius <jan@willamowius.de> Date: 周一, 22 4月 2019 01:58:13 +0800 Subject: [PATCH] fix gcc 5.4 warnings --- src/library/os/os.h | 26 ++++++++++++++++++++++---- 1 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/library/os/os.h b/src/library/os/os.h index 5061ac5..d953d1a 100644 --- a/src/library/os/os.h +++ b/src/library/os/os.h @@ -2,7 +2,7 @@ * os-dependent.hpp * * Created on: Mar 29, 2014 - * Author: devel + * */ #ifndef OS_DEPENDENT_HPP_ @@ -14,18 +14,31 @@ #include "../base/base.h" #include <stddef.h> +#include <string.h> +#include <ctype.h> +#include <sys/types.h> +#include <unistd.h> +//definition of size_t +#include <stdlib.h> +#ifdef __unix__ #include <stdbool.h> +#endif typedef enum { NONE, VMWARE } VIRTUALIZATION; +typedef enum { + IFACE_TYPE_ETHERNET, IFACE_TYPE_WIRELESS +} IFACE_TYPE; + typedef struct { int id; char description[1024]; - unsigned char mac_address[6]; + unsigned char mac_address[8]; unsigned char ipv4_address[4]; -} AdapterInfo; + IFACE_TYPE type; +} OsAdapterInfo; typedef struct { int id; @@ -35,10 +48,13 @@ bool preferred; } DiskInfo; -FUNCTION_RETURN getAdapterInfos(AdapterInfo * adapterInfos, +FUNCTION_RETURN getAdapterInfos(OsAdapterInfo * adapterInfos, size_t * adapter_info_size); FUNCTION_RETURN getDiskInfos(DiskInfo * diskInfos, size_t * disk_info_size); FUNCTION_RETURN getUserHomePath(char[MAX_PATH]); +FUNCTION_RETURN getModuleName(char buffer[MAX_PATH]); +FUNCTION_RETURN getCpuId(unsigned char identifier[6]); +FUNCTION_RETURN getMachineName(unsigned char identifier[6]); /** * Get an identifier of the machine in an os specific way. * In Linux it uses: @@ -61,6 +77,8 @@ VIRTUALIZATION getVirtualization(); void os_initialize(); +FUNCTION_RETURN verifySignature(const char* stringToVerify, const char* signatureB64); + #ifdef __cplusplus } #endif -- Gitblit v1.9.1