fix_flex.php 376 B

12345678910
  1. <?php
  2. $filename = $argv[1];
  3. $contents = file_get_contents($filename);
  4. if ($contents === FALSE) exit(1);
  5. $search = array("<inttypes.h>", "#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L");
  6. $replace = array("<stdint.h>", "#if 1");
  7. $contents = str_replace($search, $replace, $contents);
  8. $res = file_put_contents($filename, $contents);
  9. if ($res === FALSE) exit(1);