mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 14:06:16 +02:00
allow to c api with older c versions
In the FFI world we have many tools that are not gcc/clang and therefore not always support the latest C standard. This fixes support with cffi i.e. used in https://github.com/tweag/python-nix
This commit is contained in:
parent
838b666a80
commit
739418504c
1 changed files with 11 additions and 1 deletions
|
@ -14,6 +14,16 @@
|
||||||
#include "nix_api_util.h"
|
#include "nix_api_util.h"
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#ifndef __has_c_attribute
|
||||||
|
# define __has_c_attribute(x) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __has_c_attribute(deprecated)
|
||||||
|
# define NIX_DEPRECATED(msg) [[deprecated(msg)]]
|
||||||
|
#else
|
||||||
|
# define NIX_DEPRECATED(msg)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
@ -45,7 +55,7 @@ typedef struct EvalState EvalState; // nix::EvalState
|
||||||
* @see nix_value_incref, nix_value_decref
|
* @see nix_value_incref, nix_value_decref
|
||||||
*/
|
*/
|
||||||
typedef struct nix_value nix_value;
|
typedef struct nix_value nix_value;
|
||||||
[[deprecated("use nix_value instead")]] typedef nix_value Value;
|
NIX_DEPRECATED("use nix_value instead") typedef nix_value Value;
|
||||||
|
|
||||||
// Function prototypes
|
// Function prototypes
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue