Browse Source

Genconfig DUK_LOSE_CONST (unused initially)

pull/426/head
Sami Vaarala 9 years ago
parent
commit
0b41cd9475
  1. 4
      config/genconfig.py
  2. 5
      config/header-snippets/loseconst.h.in

4
config/genconfig.py

@ -1058,6 +1058,8 @@ def generate_autodetect_duk_config_header(opts, meta_dir):
ret.empty()
ret.snippet_relative('unreferenced.h.in')
ret.empty()
ret.snippet_relative('loseconst.h.in')
ret.empty()
ret.snippet_relative('noreturn.h.in')
ret.empty()
ret.snippet_relative('unreachable.h.in')
@ -1421,6 +1423,8 @@ def generate_autodetect_duk_config_header_modular(opts, meta_dir):
ret.empty()
ret.snippet_relative('unreferenced.h.in')
ret.empty()
ret.snippet_relative('loseconst.h.in')
ret.empty()
ret.snippet_relative('noreturn.h.in')
ret.empty()
ret.snippet_relative('unreachable.h.in')

5
config/header-snippets/loseconst.h.in

@ -0,0 +1,5 @@
/* Convert any input pointer into a "void *", losing a const qualifier.
* This is not fully portable because casting through duk_uintptr_t may
* not work on all architectures (e.g. those with long, segmented pointers).
*/
#define DUK_LOSE_CONST(src) ((void *) (duk_uintptr_t) (src))
Loading…
Cancel
Save