--- OpenCL/h_extract 2012/05/05 13:30:07 1.6 +++ OpenCL/h_extract 2012/05/05 14:04:25 1.7 @@ -3,34 +3,36 @@ # extracts various bits of data form OpenCL heder files, which are expected to # be in CL/ +ALL_H="CL/cl.h CL/cl_ext.h CL/cl_gl.h CL/cl_gl_ext.h CL11/cl_d3d9.h CL/cl_d3d10.h CL12/cl_d3d11.h CL/cl_dx9_media_sharing.h" + # constants ( echo '// autogenerated by h_extract' - cat CL/cl.h CL/cl_ext.h CL/cl_gl.h CL/cl_gl_ext.h CL/cl_d3d10.h | + cat $ALL_H | perl -ne 'print "const_iv($1)\n" if /^#define CL_(\S+)/' -) >constiv.h +) | sort >constiv.h # constants that look like enum values ( echo '// autogenerated by h_extract' - cat CL/cl.h CL/cl_ext.h CL/cl_gl.h CL/cl_gl_ext.h CL/cl_d3d10.h | + cat $ALL_H | perl -ne 'print "const_iv($1)\n" if /^#define CL_(\S+)\s+0x[0-9a-fA-F]{4}/' -) >enumstr.h +) | sort >enumstr.h # error codes ( echo '// autogenerated by h_extract' echo "const_iv(SUCCESS)" - cat CL/cl.h CL/cl_ext.h CL/cl_gl.h CL/cl_gl_ext.h CL/cl_d3d10.h | + cat $ALL_H | perl -ne 'print "const_iv($1)\n" if !/#define CL_BUILD_(?:NONE|ERROR|IN_PROGRESS)/ && /^#define CL_(\S+)\s+-\d+\s*$/' -) >errstr.h +) | sort >errstr.h # default constant values to -1 ( echo '// autogenerated by h_extract' cat constiv.h enumstr.h errstr.h | perl -ne '/const_iv\((.*)\)/ or next; print "#ifndef CL_$1\n#define CL_$1 -1\n#endif\n"' -) >default.h +) | sort >default.h # *glGet*Info ( @@ -58,5 +60,5 @@ cl_kernel_arg_info, CL_KERNEL_ARG_TYPE_QUALIFIER, cl_kernel_arg_type_qualifier cl_kernel_arg_info, CL_KERNEL_ARG_NAME, STRING_CLASS EOF -) >getinfo.txt +) | sort >getinfo.txt