detect nsec struct stat systems

fixes #2
This commit is contained in:
Carsten Haitzler 2023-08-27 14:48:15 +01:00
parent b0b34c95ae
commit c8a537f3a8
3 changed files with 18 additions and 2 deletions

View File

@ -11,6 +11,15 @@ deps = [
dependency('emotion', version: '>= 1.26.0'),
m_dep
]
bsd = ['bsd', 'freebsd', 'dragonfly', 'netbsd', 'openbsd']
linux = ['linux']
sun = ['sunos']
sys_linux = linux.contains(host_machine.system())
sys_bsd = bsd.contains(host_machine.system())
sys_sun = sun.contains(host_machine.system())
dir_prefix = get_option('prefix')
dir_bin = join_paths(dir_prefix, get_option('bindir'))
dir_lib = join_paths(dir_prefix, get_option('libdir'))
@ -32,6 +41,11 @@ cfg.set ('_POSIX_PTHREAD_SEMANTICS', 1)
cfg.set ('_ALL_SOURCE' , 1)
cfg.set ('_POSIX_SOURCE' , 1)
cfg.set ('_POSIX_1_SOURCE' , 1)
if sys_linux or sys_bsd or sys_sun
cfg.set('STAT_NSEC', '1')
endif
configure_file(output: 'efm_config.h', configuration: cfg)
subdir('src')
subdir('data')

View File

@ -1,8 +1,10 @@
#include "sha.h"
#include "efm_config.h"
#include <Eina.h>
#include <arpa/inet.h>
#include <string.h>
#include <stdio.h>
#include <sys/stat.h>
void
sha1_stat(const struct stat *st, unsigned char dst[20])

View File

@ -1,8 +1,8 @@
#ifndef SHA_H
# define SHA_H 1
// get nsec in stat
#define STAT_NSEC 1
# include "efm_config.h"
#include <sys/stat.h>
void sha1_stat(const struct stat *st, unsigned char dst[20]);