mirror of
https://github.com/libtom/libtomcrypt
synced 2026-08-25 20:26:07 -04:00
fix basename(..) in demos
This commit is contained in:
parent
9e446e665f
commit
42489a16cb
3 changed files with 7 additions and 15 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue