mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
use 0 (configurable) for the C++ size of flexible arrays (fixes #808)
This commit is contained in:
parent
4d45583637
commit
a127a332ac
2 changed files with 11 additions and 2 deletions
|
@ -324,6 +324,15 @@
|
||||||
#define SEXP_MAX_ANALYZE_DEPTH 8192
|
#define SEXP_MAX_ANALYZE_DEPTH 8192
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* The size of flexible arrays (empty arrays at the end of a struct */
|
||||||
|
/* representing the trailing data), when compiled with C++. Technically */
|
||||||
|
/* 0 is an illegal value here, and the C++ idiom is to use 1, but this */
|
||||||
|
/* breaks compatibility with C when computing the size of structs, and */
|
||||||
|
/* in practice all of the major C++ compilers support 0. */
|
||||||
|
#ifndef SEXP_FLEXIBLE_ARRAY_SIZE
|
||||||
|
#define SEXP_FLEXIBLE_ARRAY_SIZE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* DEFAULTS - DO NOT MODIFY ANYTHING BELOW THIS LINE */
|
/* DEFAULTS - DO NOT MODIFY ANYTHING BELOW THIS LINE */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* sexp.h -- header for sexp library */
|
/* sexp.h -- header for sexp library */
|
||||||
/* Copyright (c) 2009-2015 Alex Shinn. All rights reserved. */
|
/* Copyright (c) 2009-2022 Alex Shinn. All rights reserved. */
|
||||||
/* BSD-style license: http://synthcode.com/license.txt */
|
/* BSD-style license: http://synthcode.com/license.txt */
|
||||||
|
|
||||||
#ifndef SEXP_H
|
#ifndef SEXP_H
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#define SEXP_FLEXIBLE_ARRAY [1]
|
#define SEXP_FLEXIBLE_ARRAY [SEXP_FLEXIBLE_ARRAY_SIZE]
|
||||||
#else
|
#else
|
||||||
#define SEXP_FLEXIBLE_ARRAY []
|
#define SEXP_FLEXIBLE_ARRAY []
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue