From fa29891ded522e5b5b0f7dd6805ca89dc55c21d0 Mon Sep 17 00:00:00 2001
From: Alex Lin <alexander.s.lin@nasa.gov>
Date: Fri, 29 Jan 2016 09:43:43 -0600
Subject: [PATCH] Introduce Open Dynamics Engine examples

Changed the regular expressions that removes comments in convert_swig to
try and handle C style comments found in multiline #define statements.

Also added a TRICK_ICG_NOCOMMENT line to SIM_ode to stop ICG from
trying to process non-Trick comments in the ODE directory.

refs #172
---
 libexec/trick/convert_swig        | 5 +++--
 trick_sims/SIM_ode/S_overrides.mk | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libexec/trick/convert_swig b/libexec/trick/convert_swig
index 56011745..7710a575 100755
--- a/libexec/trick/convert_swig
+++ b/libexec/trick/convert_swig
@@ -218,8 +218,9 @@ sub process_file() {
         $raw_contents = <IN_FILE> ;
 
         # remove all comments, they can cause all kinds of trouble
-        # leave the line continuation character if present in a c++ style comment.
-        $raw_contents =~ s/\/\*(?:.*?)\*\/|\/\/(?:.*?)(\\)?(\n)/$1\n/sg ;
+        # leave the line continuation character if present
+        $raw_contents =~ s/\/\*(?:.*?)\*\/(\s*\\\n)?/$1/sg ;
+        $raw_contents =~ s/\/\/(?:.*?)(\\)?(\n)/$1\n/sg ;
 
 ##      The init_attr functions cause problems when we try and wrap them with SWIG.
 ##      We can safely remove them from the header files.
diff --git a/trick_sims/SIM_ode/S_overrides.mk b/trick_sims/SIM_ode/S_overrides.mk
index 304de7cc..9c43cab3 100644
--- a/trick_sims/SIM_ode/S_overrides.mk
+++ b/trick_sims/SIM_ode/S_overrides.mk
@@ -2,6 +2,7 @@
 ODE_HOME = /users/alin/ode-0.14
 
 TRICK_ICG_EXCLUDE = ${ODE_HOME}/ode/src/array.h:${ODE_HOME}/ode/src/threading_base.h
+TRICK_ICG_NOCOMMENT = ${ODE_HOME}
 TRICK_SWIG_EXCLUDE = ${ODE_HOME}
 
 TRICK_CFLAGS += -I${TRICK_HOME}/trick_models -I${ODE_HOME}/include -I${ODE_HOME}