Bugfix/c89 compile fixes (#327)
* Fix code to be able to compile with older C89 ANSI compilers * Convert C++ comments to C89 comments. * default to std=gnu89 * Fix to enable CMake 3.1 to build on Centos7 Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
# This script converts any C++ comments to C comments
|
||||
# using the ccmtcnvt tool from the liwc package
|
||||
|
||||
CONVERTER=/usr/bin/ccmtcnvt
|
||||
# silent fail if the tool is not installed
|
||||
[ -x ${CONVERTER} ] || exit 0
|
||||
|
||||
directory=${1-`pwd`}
|
||||
for filename in $( find ${directory} -name '*.c' )
|
||||
do
|
||||
echo Converting ${filename}
|
||||
TEMPFILE="/tmp/ccmtcnvt.$RANDOM.txt"
|
||||
${CONVERTER} ${filename} > ${TEMPFILE}
|
||||
mv ${TEMPFILE} ${filename}
|
||||
done
|
||||
|
||||
for filename in $( find ${directory} -name '*.h' )
|
||||
do
|
||||
echo Converting ${filename}
|
||||
TEMPFILE="/tmp/ccmtcnvt.$RANDOM.txt"
|
||||
${CONVERTER} ${filename} > ${TEMPFILE}
|
||||
mv ${TEMPFILE} ${filename}
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user