fix basename(..) in demos

This commit is contained in:
Karel Miko 2026-05-03 23:53:48 +02:00 committed by Steffen Jaeckel
parent 9e446e665f
commit 42489a16cb
3 changed files with 7 additions and 15 deletions

View file

@ -2,11 +2,8 @@
/* SPDX-License-Identifier: Unlicense */
#include "tomcrypt.h"
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L
#include <libgen.h>
#else
#define basename(x) x
#endif
#include <string.h>
#define basename(path) ( strrchr((path), '/') ? strrchr((path), '/') + 1 : strrchr((path), '\\') ? strrchr((path), '\\') + 1 : (path) )
/**
@file demo_crypt_constants.c

View file

@ -12,11 +12,8 @@
#include <tomcrypt.h>
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L
#include <libgen.h>
#else
#define basename(x) x
#endif
#include <string.h>
#define basename(path) ( strrchr((path), '/') ? strrchr((path), '/') + 1 : strrchr((path), '\\') ? strrchr((path), '\\') + 1 : (path) )
#if !defined(PATH_MAX) && defined(_MSC_VER)
#include <windows.h>

View file

@ -3,11 +3,9 @@
#include "tomcrypt.h"
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L
#include <libgen.h>
#else
#define basename(x) x
#endif
#include <string.h>
#define basename(path) ( strrchr((path), '/') ? strrchr((path), '/') + 1 : strrchr((path), '\\') ? strrchr((path), '\\') + 1 : (path) )
/**
@file demo_crypt_sizes.c