ext/Rakefile in ruby-vpi-15.0.0 vs ext/Rakefile in ruby-vpi-15.0.1
- old
+ new
@@ -48,9 +48,18 @@
file 'swig_wrap.cin' => 'swig_vpi.i' do |t|
sh %w{swig -ruby -o}, t.name, t.prerequisites[0]
end
-file 'swig_vpi.i' => 'vpi_user.h'
+file 'swig_vpi.i' => 'swig_vpi.h'
+
+# avoid compilation problems due to va_list, which is used in the SWIG-generated wrapper for VPI vprintf functions
+file 'swig_vpi.h' => 'vpi_user.h' do |t|
+ src, dst = t.prerequisites[0], t.name
+
+ File.open(dst, 'w') do |f|
+ f << File.read(src).gsub(/\bva_list\b/, 'int')
+ end
+end
# NOTE: since SWIG is not a requirement for users, we should not clobber these generated files
#CLOBBER.include 'swig_wrap.cin', 'swig_vpi.h'