pike.git / src / post_modules / GL / gen.pike

version» Context lines:

pike.git/src/post_modules/GL/gen.pike:479:    foreach(fn, string f) {    array(string) r = gen_func(f, ty[f]);    res += r[0];    prot[f]=r[1];    }    res += "void GL_add_auto_funcs()\n{\n";    res += " pre_init();\n";    foreach(fn, string f)    res += " add_function_constant(\""+f+"\", f_"+f+",\n\t\t\t\"function("+    prot[f]+")\", OPT_SIDE_EFFECT);\n"; -  foreach(sort(indices(constants)), string co) +  foreach(sort(indices(constants)), string co) { +  int val = constants[co]; +  if (val >= 1 << 31) +  res += sprintf (#"\ + #ifdef INT64 +  push_int64(%dLL); + #else +  push_int(%d); +  push_int(31); +  f_lsh(2); +  push_int(%d); +  f_or(2); + #endif +  simple_add_constant(%O, Pike_sp-1, 0); +  pop_stack(); + ", +  val, val >> 31, val & ((1 << 31) - 1), co); +  else    res += " add_integer_constant(\""+co+"\", "+ -  (string)constants[co]+", 0);\n"; +  (string)val+", 0);\n"; +  }    res += " post_init();\n";    res += "}\n";    return res;   }      void main(int argc, array(string) argv)   {    array(string) f = Stdio.File("stdin")->read()/"@@";    write(({    "#line 1 \"auto.c.in\"\n",    f[0], -  sprintf("\n#line 1 %O\n", "generated by " + __FILE__), +  sprintf("\n#line %d \"auto.c (generated by %s)\"\n", +  String.count (f[0], "\n") + 4, __FILE__),    gen(),    sprintf("\n#line %d \"auto.c.in\"\n", sizeof(f[0]/"\n")),    @f[1..]})*"");   }