From 783d8552ef3359160b938843f1095d90fa58fb66 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 19 Oct 2014 22:32:30 +0000 Subject: [PATCH] Fix bin2c to generate an include to stddef.h (for size_t definition) --- panda/src/express/ca_bundle_data_src.c | 2 ++ panda/src/framework/rock_floor.rgb_src.c | 2 ++ panda/src/framework/shuttle_controls.bam_src.c | 2 ++ panda/src/osxdisplay/resize_box.rgb.c | 2 ++ panda/src/text/cmss12.bam.pz_src.c | 2 ++ panda/src/text/cmss12.bam_src.c | 2 ++ panda/src/text/persans.ttf_src.c | 2 ++ pandatool/src/miscprogs/binToC.cxx | 13 ++++++++----- pandatool/src/vrml/standardNodes.wrl.c | 2 ++ pandatool/src/vrml/standardNodes.wrl.pz.c | 2 ++ pandatool/src/xfile/standardTemplates.x.c | 2 ++ pandatool/src/xfile/standardTemplates.x.pz.c | 2 ++ 12 files changed, 30 insertions(+), 5 deletions(-) diff --git a/panda/src/express/ca_bundle_data_src.c b/panda/src/express/ca_bundle_data_src.c index 62c1c339d2..bec7ee7745 100644 --- a/panda/src/express/ca_bundle_data_src.c +++ b/panda/src/express/ca_bundle_data_src.c @@ -11,6 +11,8 @@ * in DER form, for compiling into OpenSSLWrapper. */ +#include + static const unsigned char ca_bundle_data[] = { 0x30, 0x82, 0x02, 0x5a, 0x30, 0x82, 0x01, 0xc3, 0x02, 0x02, 0x01, 0xa5, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, diff --git a/panda/src/framework/rock_floor.rgb_src.c b/panda/src/framework/rock_floor.rgb_src.c index 455e091be6..3896731def 100755 --- a/panda/src/framework/rock_floor.rgb_src.c +++ b/panda/src/framework/rock_floor.rgb_src.c @@ -5,6 +5,8 @@ * bin2c -static -string -n rock_floor -o rock_floor.rgb.c rock-floor.rgb */ +#include + static const unsigned char rock_floor[] = { 0x01, 0xda, 0x01, 0x01, 0x00, 0x03, 0x01, 0x00, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, diff --git a/panda/src/framework/shuttle_controls.bam_src.c b/panda/src/framework/shuttle_controls.bam_src.c index 7456af0c5b..a9e14c91ee 100755 --- a/panda/src/framework/shuttle_controls.bam_src.c +++ b/panda/src/framework/shuttle_controls.bam_src.c @@ -5,6 +5,8 @@ * bin2c -static -string -n shuttle_controls -o shuttle_controls.bam.c shuttle_controls.bam */ +#include + static const unsigned char shuttle_controls[] = { 0x70, 0x62, 0x6a, 0x00, 0x0a, 0x0d, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x12, 0x00, 0x01, 0x9c, 0x00, 0x00, 0x00, 0x43, 0x01, 0x09, diff --git a/panda/src/osxdisplay/resize_box.rgb.c b/panda/src/osxdisplay/resize_box.rgb.c index e7ef10af6c..eecce8c1e5 100644 --- a/panda/src/osxdisplay/resize_box.rgb.c +++ b/panda/src/osxdisplay/resize_box.rgb.c @@ -5,6 +5,8 @@ * bin2c -static -string -n resize_box -o resize_box.rgb.c resize_box.rgb */ +#include + static const unsigned char resize_box[] = { 0x01, 0xda, 0x01, 0x01, 0x00, 0x03, 0x00, 0x10, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, diff --git a/panda/src/text/cmss12.bam.pz_src.c b/panda/src/text/cmss12.bam.pz_src.c index 20b651cfac..a74e00ce76 100644 --- a/panda/src/text/cmss12.bam.pz_src.c +++ b/panda/src/text/cmss12.bam.pz_src.c @@ -5,6 +5,8 @@ * bin2c -n default_font_data -o cmss12.bam.pz.c cmss12.bam.pz */ +#include + const unsigned char default_font_data[] = { 0x78, 0x9c, 0xec, 0xbd, 0x0d, 0x5c, 0x54, 0xc5, 0xfe, 0x3f, 0x7e, 0xe0, 0x78, 0x37, 0x30, 0x79, 0x30, 0x44, 0x41, 0x49, 0x44, 0x43, diff --git a/panda/src/text/cmss12.bam_src.c b/panda/src/text/cmss12.bam_src.c index b2a4af9916..733672de00 100644 --- a/panda/src/text/cmss12.bam_src.c +++ b/panda/src/text/cmss12.bam_src.c @@ -5,6 +5,8 @@ * bin2c -n default_font_data -o cmss12.bam.c cmss12.bam */ +#include + const unsigned char default_font_data[] = { 0x70, 0x62, 0x6a, 0x00, 0x0a, 0x0d, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x12, 0x00, 0x01, 0x92, 0x00, 0x00, 0x00, 0x43, 0x01, 0x09, diff --git a/panda/src/text/persans.ttf_src.c b/panda/src/text/persans.ttf_src.c index dfd77ce26c..e7fa4a9fb4 100755 --- a/panda/src/text/persans.ttf_src.c +++ b/panda/src/text/persans.ttf_src.c @@ -5,6 +5,8 @@ * bin2c -n default_font_data -o persans.ttf.c persans.ttf */ +#include + const unsigned char default_font_data[] = { 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x80, 0x00, 0x03, 0x00, 0x30, 0x4f, 0x53, 0x2f, 0x32, 0x13, 0xab, 0x02, 0x15, 0x00, 0x00, diff --git a/pandatool/src/miscprogs/binToC.cxx b/pandatool/src/miscprogs/binToC.cxx index c711a21e2b..40eb02145e 100644 --- a/pandatool/src/miscprogs/binToC.cxx +++ b/pandatool/src/miscprogs/binToC.cxx @@ -40,12 +40,12 @@ BinToC() : "for portably importing binary data into a library or executable."); add_option - ("n", "name", 0, + ("n", "name", 0, "Specify the name of the table that is generated.", &BinToC::dispatch_string, NULL, &_table_name); add_option - ("static", "", 0, + ("static", "", 0, "Flag the table with the keyword 'static'.", &BinToC::dispatch_none, &_static_table); @@ -55,7 +55,7 @@ BinToC() : &BinToC::dispatch_none, &_for_string); add_option - ("o", "filename", 0, + ("o", "filename", 0, "Specify the filename to which the resulting C code will be written. " "If this option is omitted, the last parameter name is taken to be the " "name of the output file, or standard output is used if there are no " @@ -98,7 +98,10 @@ run() { << " * This table was generated by the command:\n" << " *\n" << " * " << get_exec_command() << "\n" - << " */\n\n" + << " */\n" + << "\n" + << "#include \n" + << "\n" << static_keyword << table_type << _table_name << "[] = {"; out << hex << setfill('0'); int count = 0; @@ -120,7 +123,7 @@ run() { ch = in.get(); } out << "\n};\n\n" - << static_keyword << length_type << _table_name << "_len = " + << static_keyword << length_type << _table_name << "_len = " << dec << count << ";\n\n"; } diff --git a/pandatool/src/vrml/standardNodes.wrl.c b/pandatool/src/vrml/standardNodes.wrl.c index ff4276080f..bef3956364 100644 --- a/pandatool/src/vrml/standardNodes.wrl.c +++ b/pandatool/src/vrml/standardNodes.wrl.c @@ -5,6 +5,8 @@ * bin2c -n standard_nodes_data -o standardNodes.wrl.c standardNodes.wrl */ +#include + const unsigned char standard_nodes_data[] = { 0x23, 0x56, 0x52, 0x4d, 0x4c, 0x20, 0x56, 0x32, 0x2e, 0x30, 0x20, 0x75, 0x74, 0x66, 0x38, 0x0a, 0x23, 0x0a, 0x23, 0x20, 0x2a, 0x2a, diff --git a/pandatool/src/vrml/standardNodes.wrl.pz.c b/pandatool/src/vrml/standardNodes.wrl.pz.c index 5b88149c46..f573f1c41e 100644 --- a/pandatool/src/vrml/standardNodes.wrl.pz.c +++ b/pandatool/src/vrml/standardNodes.wrl.pz.c @@ -5,6 +5,8 @@ * bin2c -n standard_nodes_data -o standardNodes.wrl.pz.c standardNodes.wrl.pz */ +#include + const unsigned char standard_nodes_data[] = { 0x78, 0x9c, 0xd5, 0x5b, 0x5b, 0x6f, 0xdb, 0x38, 0x16, 0x7e, 0xcf, 0xaf, 0x20, 0xd2, 0x97, 0x76, 0xd1, 0x09, 0x62, 0x17, 0xbd, 0xcd, diff --git a/pandatool/src/xfile/standardTemplates.x.c b/pandatool/src/xfile/standardTemplates.x.c index 7ef2f6adcb..d4c8213d25 100644 --- a/pandatool/src/xfile/standardTemplates.x.c +++ b/pandatool/src/xfile/standardTemplates.x.c @@ -5,6 +5,8 @@ * bin2c -n standard_templates_data -o standardTemplates.x.c standardTemplates.x */ +#include + const unsigned char standard_templates_data[] = { 0x78, 0x6f, 0x66, 0x20, 0x30, 0x33, 0x30, 0x33, 0x74, 0x78, 0x74, 0x20, 0x30, 0x30, 0x33, 0x32, 0x0a, 0x0a, 0x23, 0x20, 0x54, 0x68, diff --git a/pandatool/src/xfile/standardTemplates.x.pz.c b/pandatool/src/xfile/standardTemplates.x.pz.c index 21743add83..4613dc55bb 100755 --- a/pandatool/src/xfile/standardTemplates.x.pz.c +++ b/pandatool/src/xfile/standardTemplates.x.pz.c @@ -5,6 +5,8 @@ * bin2c -n standard_templates_data -o standardTemplates.x.pz.c standardTemplates.x.pz */ +#include + const unsigned char standard_templates_data[] = { 0x78, 0x9c, 0xa5, 0x58, 0x6b, 0x6f, 0xdb, 0x38, 0x16, 0xfd, 0xee, 0x5f, 0x41, 0x4c, 0x80, 0x6e, 0x67, 0x11, 0x65, 0xf5, 0x7e, 0xac,