Amalgamate src/simdjson.cpp as-is
amalgamation.sh shouldn't change contents of src/simdjson.cpp by forcing dmalloc.h that didn't exist in non-amalgamated version and shouldn't change order of includes by placing simdjson.h at the top fixes #739
This commit is contained in:
parent
e2718fe845
commit
24a185d26b
|
@ -46,7 +46,7 @@ function doinclude()
|
||||||
if [[ ! " ${found_includes[@]} " =~ " ${file} " ]]; then
|
if [[ ! " ${found_includes[@]} " =~ " ${file} " ]]; then
|
||||||
found_includes+=("$file")
|
found_includes+=("$file")
|
||||||
dofile $AMALGAMATE_INCLUDE_PATH $file
|
dofile $AMALGAMATE_INCLUDE_PATH $file
|
||||||
fi;
|
fi
|
||||||
elif [ -f $AMALGAMATE_SOURCE_PATH/$file ]; then
|
elif [ -f $AMALGAMATE_SOURCE_PATH/$file ]; then
|
||||||
# generic includes are included multiple times
|
# generic includes are included multiple times
|
||||||
if [[ "${file}" == *'generic/'*'.h' ]]; then
|
if [[ "${file}" == *'generic/'*'.h' ]]; then
|
||||||
|
@ -73,10 +73,15 @@ function dofile()
|
||||||
do
|
do
|
||||||
if [[ "${line}" == '#include "'*'"'* ]]; then
|
if [[ "${line}" == '#include "'*'"'* ]]; then
|
||||||
file=$(echo $line| cut -d'"' -f 2)
|
file=$(echo $line| cut -d'"' -f 2)
|
||||||
|
# include all from simdjson.cpp except simdjson.h
|
||||||
|
if [ "${file}" == "simdjson.h" ] && [ "${2}" == "simdjson.cpp" ]; then
|
||||||
|
echo "$line"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "${file}" == '../'* ]]; then
|
if [[ "${file}" == '../'* ]]; then
|
||||||
file=$(echo $file| cut -d'/' -f 2-)
|
file=$(echo $file| cut -d'/' -f 2-)
|
||||||
fi;
|
fi
|
||||||
|
|
||||||
# we explicitly include simdjson headers, one time each (unless they are generic, in which case multiple times is fine)
|
# we explicitly include simdjson headers, one time each (unless they are generic, in which case multiple times is fine)
|
||||||
doinclude $file $line
|
doinclude $file $line
|
||||||
|
@ -108,15 +113,6 @@ echo "/* auto-generated on ${timestamp}. Do not edit! */" > ${AMAL_H}
|
||||||
echo "Creating ${AMAL_C}..."
|
echo "Creating ${AMAL_C}..."
|
||||||
echo "/* auto-generated on ${timestamp}. Do not edit! */" > ${AMAL_C}
|
echo "/* auto-generated on ${timestamp}. Do not edit! */" > ${AMAL_C}
|
||||||
{
|
{
|
||||||
echo "#include \"simdjson.h\""
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo "/* used for http://dmalloc.com/ Dmalloc - Debug Malloc Library */"
|
|
||||||
echo "#ifdef DMALLOC"
|
|
||||||
echo "#include \"dmalloc.h\""
|
|
||||||
echo "#endif"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
for file in ${ALLCFILES}; do
|
for file in ${ALLCFILES}; do
|
||||||
dofile $AMALGAMATE_SOURCE_PATH $file
|
dofile $AMALGAMATE_SOURCE_PATH $file
|
||||||
done
|
done
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
#include "simdjson.h"
|
#include "simdjson.h"
|
||||||
|
|
||||||
|
/* used for http://dmalloc.com/ Dmalloc - Debug Malloc Library */
|
||||||
|
#ifdef DMALLOC
|
||||||
|
#include "dmalloc.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "error.cpp"
|
#include "error.cpp"
|
||||||
#include "implementation.cpp"
|
#include "implementation.cpp"
|
||||||
#include "stage1_find_marks.cpp"
|
#include "stage1_find_marks.cpp"
|
||||||
|
|
Loading…
Reference in New Issue