Browse Source

Fix bin2c to generate an include to stddef.h (for size_t definition)

rdb 11 years ago
parent
commit
783d8552ef

+ 2 - 0
panda/src/express/ca_bundle_data_src.c

@@ -11,6 +11,8 @@
  * in DER form, for compiling into OpenSSLWrapper.
  */
 
+#include <stddef.h>
+
 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,

+ 2 - 0
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 <stddef.h>
+
 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,

+ 2 - 0
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 <stddef.h>
+
 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,

+ 2 - 0
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 <stddef.h>
+
 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,

+ 2 - 0
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 <stddef.h>
+
 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,

+ 2 - 0
panda/src/text/cmss12.bam_src.c

@@ -5,6 +5,8 @@
  * bin2c -n default_font_data -o cmss12.bam.c cmss12.bam
  */
 
+#include <stddef.h>
+
 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,

+ 2 - 0
panda/src/text/persans.ttf_src.c

@@ -5,6 +5,8 @@
  * bin2c -n default_font_data -o persans.ttf.c persans.ttf
  */
 
+#include <stddef.h>
+
 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,

+ 8 - 5
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 <stddef.h>\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";
 }
 

+ 2 - 0
pandatool/src/vrml/standardNodes.wrl.c

@@ -5,6 +5,8 @@
  * bin2c -n standard_nodes_data -o standardNodes.wrl.c standardNodes.wrl
  */
 
+#include <stddef.h>
+
 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,

+ 2 - 0
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 <stddef.h>
+
 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,

+ 2 - 0
pandatool/src/xfile/standardTemplates.x.c

@@ -5,6 +5,8 @@
  * bin2c -n standard_templates_data -o standardTemplates.x.c standardTemplates.x
  */
 
+#include <stddef.h>
+
 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,

+ 2 - 0
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 <stddef.h>
+
 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,