servo/etc/jsdefine
author Ryan VanderMeulen <ryanvm@gmail.com>
Wed, 11 Apr 2018 09:24:02 -0400
changeset 468936 f041c724fb809d3c927000e38bf67034d3a3930e
parent 383855 011d6feca67a86ea040809de94e51c634766265f
permissions -rwxr-xr-x
Bug 1453317 - Update VS2017 used in automation to version 15.6.6. r=froydnj CLOSED TREE

#!/bin/bash
#
# Handy tool for extracting #defines from jsapi.h.  For example:
#     ./jsdefine %x JSCLASS_GLOBAL_FLAGS
# outputs
#     48000

ETCDIR=$(dirname $0)
JSDIR=${ETCDIR}/../../build/src/mozjs/dist/
INCDIR=${JSDIR}/include
LIBDIR=${JSDIR}/lib

echo > jsdefine.c
echo '#include "jsapi.h"' >> jsdefine.c
echo '' >> jsdefine.c
echo 'int main() {' >> jsdefine.c
echo '    printf(' >> jsdefine.c
echo '      "'"$1"'\n"', >> jsdefine.c
echo "      $2);" >> jsdefine.c
echo '}' >> jsdefine.c

g++ -I ${INCDIR} jsdefine.c -o jsdefine.exe 
./jsdefine.exe