From bf3040d4767702f09e042c58f0f5aa942ddb9a16 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 5 Aug 2008 20:00:59 -0600 Subject: mesa: glsl: generate error for main(any args) --- src/mesa/shader/slang/slang_compile.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 82df9b95d32..5ce0e2e3210 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2025,6 +2025,12 @@ parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit, A.vartable = o.vartable; A.log = C->L; + /* main() takes no parameters */ + if (mainFunc->param_count > 0) { + slang_info_log_error(A.log, "main() takes no arguments"); + return GL_FALSE; + } + _slang_codegen_function(&A, mainFunc); shader->Main = GL_TRUE; /* this shader defines main() */ -- cgit v1.2.3