summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2011-03-15 17:04:30 -0700
committerSam Roberts <vieuxtech@gmail.com>2011-03-15 17:04:30 -0700
commit7616320c29803eb21b219355a631eaf0c6cfcca3 (patch)
tree93976a670bcd3a5cc8d2d9b45e85f7feae382058
parentcdc7436cd52f499ab2ab879cdd5b4ba76787e1a6 (diff)
downloadlibnet-7616320c29803eb21b219355a631eaf0c6cfcca3.tar.gz
Notes on some problems with this approach.
-rwxr-xr-xlua/luaopts8
1 files changed, 7 insertions, 1 deletions
diff --git a/lua/luaopts b/lua/luaopts
index 7bedb11..3038fdc 100755
--- a/lua/luaopts
+++ b/lua/luaopts
@@ -1,4 +1,10 @@
#!/usr/bin/ruby -w
+=begin
+This approach doesn't work well when the options found can differ by platform.
+
+At least for defines, there need to be ifdef guards around them. PF_ defines, for example, vary
+across libc.
+=end
pattern = ARGV.shift
@@ -80,7 +86,7 @@ OPTS.each do |lname, cname, doc|
puts " #{cname},"
end
puts "};"
-puts "static int " + pattern + "_vals_size = " + OPTS.size.to_s + ";"
+puts "static int " + pattern + "_vals_size = " + OPTS.size.to_s + ";" # cvt to sizeof(pattern _vals) / sizeof(pattern _vals[0])
puts <<__
static int check_#{pattern}(lua_State* L, int argn)