Advertisement
osbios

make_list.pl

Jul 16th, 2014
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.13 KB | None | 0 0
  1. #!/usr/bin/perl
  2. ##
  3. ## Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
  4. ## Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
  5. ##
  6. ## This program is distributed under the terms and conditions of the GNU
  7. ## General Public License Version 2 as published by the Free Software
  8. ## Foundation or, at your option, any later version.
  9.  
  10. use strict;
  11. use warnings;
  12.  
  13. do 'bin/make.pl';
  14.  
  15. #---------------------------------------------------------------------------------------
  16.  
  17. # function pointer definition
  18. sub make_init_call($%)
  19. {
  20.     my $name = prefixname($_[0]);
  21.     return "  r = r || (" . $_[0] . " = (PFN" . (uc $_[0]) . "PROC)glewGetProcAddress(\"" . $name . "\")) == NULL;";
  22. }
  23.  
  24. #---------------------------------------------------------------------------------------
  25.  
  26. my @extlist = ();
  27. my %extensions = ();
  28.  
  29. if (@ARGV)
  30. {
  31.     @extlist = @ARGV;
  32.  
  33.     foreach my $ext (sort @extlist)
  34.     {
  35.         my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext);
  36.  
  37.         my $extvar = $extname;
  38.         $extvar =~ s/GL(X*)_/GL$1EW_/;
  39.  
  40.         my $extpre = $extname;
  41.         $extpre =~ s/^(W?)GL(X?).*$/\l$1gl\l$2ew/;
  42.  
  43.         #my $pextvar = prefix_varname($extvar);
  44.  
  45.         print "#ifdef $extname\n";
  46.  
  47.         if (length($extstring))
  48.         {
  49.                 print "  CONST_CAST(" . $extvar . ") = _glewSearchExtension(\"$extstring\", extStart, extEnd);\n";
  50.         }
  51.  
  52.         if (keys %$functions)
  53.         {
  54.             if ($extname =~ /WGL_.*/)
  55.             {
  56. #               print "  if (glewExperimental || " . $extvar . "|| crippled) CONST_CAST(" . $extvar . ")= !_glewInit_$extname(GLEW_CONTEXT_ARG_VAR_INIT);\n";
  57. #               print "  CONST_CAST(" . $extvar . ") = " . $extvar . " || !_glewInit_$extname(GLEW_CONTEXT_ARG_VAR_INIT);\n";
  58.                 print "  _glewInit_$extname(GLEW_CONTEXT_ARG_VAR_INIT);\n";
  59.             }
  60.             else
  61.             {
  62. #               print "  if (glewExperimental || " . $extvar . ") CONST_CAST(" . $extvar . ") = !_glewInit_$extname(GLEW_CONTEXT_ARG_VAR_INIT);\n";
  63. #               print "  CONST_CAST(" . $extvar . ") = " . $extvar . " || !_glewInit_$extname(GLEW_CONTEXT_ARG_VAR_INIT);\n";
  64.                 print "  _glewInit_$extname(GLEW_CONTEXT_ARG_VAR_INIT);\n";
  65.             }
  66.         }
  67.         print "#endif /* $extname */\n";
  68.     }
  69.  
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement