Browse Source

Merge pull request #1 from ndob/fix-g++-c++11-compilation

Fix g++ (with -std=c++11) compilation
pull/2/head
Sami Vaarala 11 years ago
parent
commit
dda6b96bef
  1. 1
      AUTHORS.txt
  2. 7
      src/duk_features.h
  3. 2
      src/duk_js_compiler.c
  4. 2
      src/duktape.h

1
AUTHORS.txt

@ -16,6 +16,7 @@ The following people have contributed code and agreed to irrevocably license
their contributions under the Duktape ``LICENSE.txt`` (in order of appearance):
* Sami Vaarala
* Niki Dobrev
Other contributions
===================

7
src/duk_features.h

@ -65,6 +65,11 @@
#define DUK_F_CPP
#endif
#undef DUK_F_CPP11
#if (__cplusplus >= 201103L)
#define DUK_F_CPP11
#endif
/*
* Provides the duk_rdtsc() inline function (if available)
*
@ -1383,7 +1388,7 @@ extern double duk_computed_nan;
#define DUK_USE_EXPLICIT_NULL_INIT
#endif
#ifdef DUK_F_C99
#if defined(DUK_F_C99) || (defined(DUK_F_CPP11) && defined(__GNUC__))
#define DUK_USE_VARIADIC_MACROS
#else
#undef DUK_USE_VARIADIC_MACROS

2
src/duk_js_compiler.c

@ -6589,7 +6589,7 @@ static int duk__js_compile_raw(duk_context *ctx) {
entry_top = duk_get_top(ctx);
DUK_ASSERT(entry_top >= 3);
comp_stk = (void *) duk_require_pointer(ctx, -1);
comp_stk = (duk_compiler_stkstate *) duk_require_pointer(ctx, -1);
comp_ctx = &comp_stk->comp_ctx_alloc;
lex_pt = &comp_stk->lex_pt_alloc;
DUK_ASSERT(comp_ctx != NULL);

2
src/duktape.h

@ -38,7 +38,7 @@ extern "C" {
#endif
#endif
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || (defined(DUK_F_CPP11) && defined(__GNUC__))
#define DUK_API_VARIADIC_MACROS
#else
#undef DUK_API_VARIADIC_MACROS

Loading…
Cancel
Save