From 03ab91f7892e69e70f70ba3bbf4c11fce8a2889e Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sat, 1 Jan 2011 11:04:18 -0600 Subject: [PATCH 1/4] Subset patch/branch for GLEW as used for NVIDIA Cg Toolkit purposes --- auto/bin/make_def_fun.pl | 2 ++ auto/bin/make_header.pl | 5 ++++- auto/bin/make_struct_fun.pl | 2 ++ auto/src/glew_head.h | 14 ++++++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/auto/bin/make_def_fun.pl b/auto/bin/make_def_fun.pl index 40e67d5..d6915e8 100755 --- a/auto/bin/make_def_fun.pl +++ b/auto/bin/make_def_fun.pl @@ -30,6 +30,8 @@ if (@ARGV) foreach my $ext (sort @extlist) { my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + print "\n#if !defined(GLEW_SUBSET) || defined(GLEW_SUBSET_$extname)\n"; output_decls($functions, \&make_pfn_decl); + print "\n#endif /* GLEW_SUBSET_$extname */\n"; } } diff --git a/auto/bin/make_header.pl b/auto/bin/make_header.pl index 934ef77..5ee101a 100755 --- a/auto/bin/make_header.pl +++ b/auto/bin/make_header.pl @@ -55,12 +55,15 @@ if (@ARGV) my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); make_separator($extname); - print "#ifndef $extname\n#define $extname 1\n"; + print "#ifndef $extname\n"; output_tokens($tokens, \&make_define); output_types($types, \&make_type); output_exacts($exacts, \&make_exact); output_decls($functions, \&make_pfn_type); + print "\n#if !defined(GLEW_SUBSET) || defined(GLEW_SUBSET_$extname)\n"; + print "#define $extname 1\n"; output_decls($functions, \&make_pfn_alias); + print "\n#endif /* GLEW_SUBSET_$extname */\n"; my $extvar = $extname; $extvar =~ s/GL(X*)_/GL$1EW_/; diff --git a/auto/bin/make_struct_fun.pl b/auto/bin/make_struct_fun.pl index c885960..139ad18 100755 --- a/auto/bin/make_struct_fun.pl +++ b/auto/bin/make_struct_fun.pl @@ -31,6 +31,8 @@ if (@ARGV) foreach my $ext (sort @extlist) { my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + print "\n#if !defined(GLEW_SUBSET) || defined(GLEW_SUBSET_$extname)\n"; output_decls($functions, \&make_pfn_decl); + print "\n#endif /* GLEW_SUBSET_$extname */\n"; } } diff --git a/auto/src/glew_head.h b/auto/src/glew_head.h index f6d39ff..9c6a9bb 100644 --- a/auto/src/glew_head.h +++ b/auto/src/glew_head.h @@ -142,6 +142,20 @@ typedef _W64 int ptrdiff_t; #endif /* _WIN32 */ +/* GLEW depends on extension string entry points for internal purposes */ + +#ifdef GLEW_SUBSET +#ifndef GLEW_SUBSET_WGL_ARB_extensions_string +#define GLEW_SUBSET_WGL_ARB_extensions_string +#endif +#ifndef GLEW_SUBSET_WGL_EXT_extensions_string +#define GLEW_SUBSET_WGL_EXT_extensions_string +#endif +#ifndef GLEW_SUBSET_GLX_VERSION_1_2 +#define GLEW_SUBSET_GLX_VERSION_1_2 +#endif +#endif + #ifdef __cplusplus extern "C" { #endif From 91bcbcec13745727f5a0befdea24d3ecfc8ea6c0 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sat, 1 Jan 2011 11:04:18 -0600 Subject: [PATCH 2/4] Subset patch/branch for GLEW as used for NVIDIA Cg Toolkit purposes --- auto/bin/make_def_fun.pl | 2 ++ auto/bin/make_header.pl | 5 ++++- auto/bin/make_struct_fun.pl | 2 ++ auto/src/glew_head.h | 14 ++++++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/auto/bin/make_def_fun.pl b/auto/bin/make_def_fun.pl index 40e67d5..d6915e8 100755 --- a/auto/bin/make_def_fun.pl +++ b/auto/bin/make_def_fun.pl @@ -30,6 +30,8 @@ if (@ARGV) foreach my $ext (sort @extlist) { my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + print "\n#if !defined(GLEW_SUBSET) || defined(GLEW_SUBSET_$extname)\n"; output_decls($functions, \&make_pfn_decl); + print "\n#endif /* GLEW_SUBSET_$extname */\n"; } } diff --git a/auto/bin/make_header.pl b/auto/bin/make_header.pl index 934ef77..5ee101a 100755 --- a/auto/bin/make_header.pl +++ b/auto/bin/make_header.pl @@ -55,12 +55,15 @@ if (@ARGV) my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); make_separator($extname); - print "#ifndef $extname\n#define $extname 1\n"; + print "#ifndef $extname\n"; output_tokens($tokens, \&make_define); output_types($types, \&make_type); output_exacts($exacts, \&make_exact); output_decls($functions, \&make_pfn_type); + print "\n#if !defined(GLEW_SUBSET) || defined(GLEW_SUBSET_$extname)\n"; + print "#define $extname 1\n"; output_decls($functions, \&make_pfn_alias); + print "\n#endif /* GLEW_SUBSET_$extname */\n"; my $extvar = $extname; $extvar =~ s/GL(X*)_/GL$1EW_/; diff --git a/auto/bin/make_struct_fun.pl b/auto/bin/make_struct_fun.pl index c885960..139ad18 100755 --- a/auto/bin/make_struct_fun.pl +++ b/auto/bin/make_struct_fun.pl @@ -31,6 +31,8 @@ if (@ARGV) foreach my $ext (sort @extlist) { my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + print "\n#if !defined(GLEW_SUBSET) || defined(GLEW_SUBSET_$extname)\n"; output_decls($functions, \&make_pfn_decl); + print "\n#endif /* GLEW_SUBSET_$extname */\n"; } } diff --git a/auto/src/glew_head.h b/auto/src/glew_head.h index f6d39ff..9c6a9bb 100644 --- a/auto/src/glew_head.h +++ b/auto/src/glew_head.h @@ -142,6 +142,20 @@ typedef _W64 int ptrdiff_t; #endif /* _WIN32 */ +/* GLEW depends on extension string entry points for internal purposes */ + +#ifdef GLEW_SUBSET +#ifndef GLEW_SUBSET_WGL_ARB_extensions_string +#define GLEW_SUBSET_WGL_ARB_extensions_string +#endif +#ifndef GLEW_SUBSET_WGL_EXT_extensions_string +#define GLEW_SUBSET_WGL_EXT_extensions_string +#endif +#ifndef GLEW_SUBSET_GLX_VERSION_1_2 +#define GLEW_SUBSET_GLX_VERSION_1_2 +#endif +#endif + #ifdef __cplusplus extern "C" { #endif From 141ad169ff565c4361acdfb19981894ab9508fe4 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sat, 1 Jan 2011 11:04:18 -0600 Subject: [PATCH 3/4] Subset patch/branch for GLEW as used for NVIDIA Cg Toolkit purposes --- auto/bin/make_def_fun.pl | 2 ++ auto/bin/make_header.pl | 5 ++++- auto/bin/make_struct_fun.pl | 2 ++ auto/src/glew_head.h | 14 ++++++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/auto/bin/make_def_fun.pl b/auto/bin/make_def_fun.pl index 40e67d5..d6915e8 100755 --- a/auto/bin/make_def_fun.pl +++ b/auto/bin/make_def_fun.pl @@ -30,6 +30,8 @@ if (@ARGV) foreach my $ext (sort @extlist) { my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + print "\n#if !defined(GLEW_SUBSET) || defined(GLEW_SUBSET_$extname)\n"; output_decls($functions, \&make_pfn_decl); + print "\n#endif /* GLEW_SUBSET_$extname */\n"; } } diff --git a/auto/bin/make_header.pl b/auto/bin/make_header.pl index 934ef77..5ee101a 100755 --- a/auto/bin/make_header.pl +++ b/auto/bin/make_header.pl @@ -55,12 +55,15 @@ if (@ARGV) my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); make_separator($extname); - print "#ifndef $extname\n#define $extname 1\n"; + print "#ifndef $extname\n"; output_tokens($tokens, \&make_define); output_types($types, \&make_type); output_exacts($exacts, \&make_exact); output_decls($functions, \&make_pfn_type); + print "\n#if !defined(GLEW_SUBSET) || defined(GLEW_SUBSET_$extname)\n"; + print "#define $extname 1\n"; output_decls($functions, \&make_pfn_alias); + print "\n#endif /* GLEW_SUBSET_$extname */\n"; my $extvar = $extname; $extvar =~ s/GL(X*)_/GL$1EW_/; diff --git a/auto/bin/make_struct_fun.pl b/auto/bin/make_struct_fun.pl index c885960..139ad18 100755 --- a/auto/bin/make_struct_fun.pl +++ b/auto/bin/make_struct_fun.pl @@ -31,6 +31,8 @@ if (@ARGV) foreach my $ext (sort @extlist) { my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + print "\n#if !defined(GLEW_SUBSET) || defined(GLEW_SUBSET_$extname)\n"; output_decls($functions, \&make_pfn_decl); + print "\n#endif /* GLEW_SUBSET_$extname */\n"; } } diff --git a/auto/src/glew_head.h b/auto/src/glew_head.h index 9f2cf2f..3f70ce8 100644 --- a/auto/src/glew_head.h +++ b/auto/src/glew_head.h @@ -158,6 +158,20 @@ typedef _W64 int ptrdiff_t; #endif /* _WIN32 */ +/* GLEW depends on extension string entry points for internal purposes */ + +#ifdef GLEW_SUBSET +#ifndef GLEW_SUBSET_WGL_ARB_extensions_string +#define GLEW_SUBSET_WGL_ARB_extensions_string +#endif +#ifndef GLEW_SUBSET_WGL_EXT_extensions_string +#define GLEW_SUBSET_WGL_EXT_extensions_string +#endif +#ifndef GLEW_SUBSET_GLX_VERSION_1_2 +#define GLEW_SUBSET_GLX_VERSION_1_2 +#endif +#endif + #ifdef __cplusplus extern "C" { #endif From 9bc3b6e7f0743a14c2e64994b325f782f547f826 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sat, 1 Jan 2011 11:04:18 -0600 Subject: [PATCH 4/4] Subset patch/branch for GLEW as used for NVIDIA Cg Toolkit purposes --- auto/bin/make_def_fun.pl | 2 ++ auto/bin/make_header.pl | 5 ++++- auto/bin/make_struct_fun.pl | 2 ++ auto/src/glew_head.h | 14 ++++++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/auto/bin/make_def_fun.pl b/auto/bin/make_def_fun.pl index 40e67d5..d6915e8 100755 --- a/auto/bin/make_def_fun.pl +++ b/auto/bin/make_def_fun.pl @@ -30,6 +30,8 @@ if (@ARGV) foreach my $ext (sort @extlist) { my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + print "\n#if !defined(GLEW_SUBSET) || defined(GLEW_SUBSET_$extname)\n"; output_decls($functions, \&make_pfn_decl); + print "\n#endif /* GLEW_SUBSET_$extname */\n"; } } diff --git a/auto/bin/make_header.pl b/auto/bin/make_header.pl index 934ef77..5ee101a 100755 --- a/auto/bin/make_header.pl +++ b/auto/bin/make_header.pl @@ -55,12 +55,15 @@ if (@ARGV) my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); make_separator($extname); - print "#ifndef $extname\n#define $extname 1\n"; + print "#ifndef $extname\n"; output_tokens($tokens, \&make_define); output_types($types, \&make_type); output_exacts($exacts, \&make_exact); output_decls($functions, \&make_pfn_type); + print "\n#if !defined(GLEW_SUBSET) || defined(GLEW_SUBSET_$extname)\n"; + print "#define $extname 1\n"; output_decls($functions, \&make_pfn_alias); + print "\n#endif /* GLEW_SUBSET_$extname */\n"; my $extvar = $extname; $extvar =~ s/GL(X*)_/GL$1EW_/; diff --git a/auto/bin/make_struct_fun.pl b/auto/bin/make_struct_fun.pl index c885960..139ad18 100755 --- a/auto/bin/make_struct_fun.pl +++ b/auto/bin/make_struct_fun.pl @@ -31,6 +31,8 @@ if (@ARGV) foreach my $ext (sort @extlist) { my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + print "\n#if !defined(GLEW_SUBSET) || defined(GLEW_SUBSET_$extname)\n"; output_decls($functions, \&make_pfn_decl); + print "\n#endif /* GLEW_SUBSET_$extname */\n"; } } diff --git a/auto/src/glew_head.h b/auto/src/glew_head.h index 26b8808..e54d640 100644 --- a/auto/src/glew_head.h +++ b/auto/src/glew_head.h @@ -158,6 +158,20 @@ typedef _W64 int ptrdiff_t; #endif /* _WIN32 */ +/* GLEW depends on extension string entry points for internal purposes */ + +#ifdef GLEW_SUBSET +#ifndef GLEW_SUBSET_WGL_ARB_extensions_string +#define GLEW_SUBSET_WGL_ARB_extensions_string +#endif +#ifndef GLEW_SUBSET_WGL_EXT_extensions_string +#define GLEW_SUBSET_WGL_EXT_extensions_string +#endif +#ifndef GLEW_SUBSET_GLX_VERSION_1_2 +#define GLEW_SUBSET_GLX_VERSION_1_2 +#endif +#endif + #ifdef __cplusplus extern "C" { #endif