Only copy constants from C to Ruby once

This avoids unnecessary duplicate constant warnings for C constants that
are defined in two legs of an #ifdef.
This commit is contained in:
Alex Young
2012-07-14 17:25:26 +01:00
parent b734a468c1
commit 69ad6d6b7a

View File

@@ -23,7 +23,8 @@ module FlexNBD
txt_lines = File.readlines( header_filename )
txt_lines.each do |line|
if line =~ /^#\s*define\s+([A-Z0-9_]+)\s+(\d+)\s*$/
const_set($1, $2.to_i)
# Bodge until I can figure out what to do with #ifdefs
const_set($1, $2.to_i) unless constants.include?( $1 )
end
end
end