nvim:eval: Fix enum declaration for ListLenSpecials

Instead of declaring an enum, this creates a global variable. As gcc10
uses -fno-common by default, global variables declared with the same
name more than once is not allowed anymore revealing this issue.

Each time this header is included, we define the enum name as a global
variable.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680
This commit is contained in:
Andreas Schneider
2020-02-17 16:33:55 +01:00
parent 38cda18626
commit ebcde1de42

View File

@@ -33,7 +33,7 @@ typedef double float_T;
enum { DO_NOT_FREE_CNT = (INT_MAX / 2) }; enum { DO_NOT_FREE_CNT = (INT_MAX / 2) };
/// Additional values for tv_list_alloc() len argument /// Additional values for tv_list_alloc() len argument
enum { enum ListLenSpecials {
/// List length is not known in advance /// List length is not known in advance
/// ///
/// To be used when there is neither a way to know how many elements will be /// To be used when there is neither a way to know how many elements will be
@@ -49,7 +49,7 @@ enum {
/// ///
/// To be used when it looks impractical to determine list length. /// To be used when it looks impractical to determine list length.
kListLenMayKnow = -3, kListLenMayKnow = -3,
} ListLenSpecials; };
/// Maximal possible value of varnumber_T variable /// Maximal possible value of varnumber_T variable
#define VARNUMBER_MAX INT64_MAX #define VARNUMBER_MAX INT64_MAX