updated some printfs, added comment about sched_yield
[mesa.git] / src / mesa / shader / slang / slang_preprocess.c
index 7159db7e1e2886f7ded3c82742ec126db67bd534..0be167e2ed9f724c9b77738f761d069550823472 100644 (file)
@@ -1,8 +1,8 @@
 /*\r
  * Mesa 3-D graphics library\r
- * Version:  6.3\r
+ * Version:  6.5\r
  *\r
- * Copyright (C) 2005  Brian Paul   All Rights Reserved.\r
+ * Copyright (C) 2005-2006  Brian Paul   All Rights Reserved.\r
  *\r
  * Permission is hereby granted, free of charge, to any person obtaining a\r
  * copy of this software and associated documentation files (the "Software"),\r
@@ -28,8 +28,7 @@
  * \author Michal Krol\r
  */\r
 \r
-#include "imports.h" \r
-#include "slang_compile.h"\r
+#include "imports.h"\r
 #include "grammar_mesa.h"\r
 #include "slang_preprocess.h"\r
 \r
@@ -66,12 +65,18 @@ int _slang_preprocess_version (const char *text, unsigned int *version, unsigned
 \r
        grammar_destroy (id);\r
 \r
+       /* there can be multiple #version directives - grab the last one */\r
        I = prod;\r
        while (I < prod + size)\r
        {\r
-               *version = (unsigned int) I[0] + (unsigned int) I[1] * 100;\r
-               *eaten = (unsigned int) I[2] + ((unsigned int) I[3] << 8) +\r
-                       ((unsigned int) I[4] << 16) + ((unsigned int) I[5] << 24);\r
+               *version =\r
+                       (unsigned int) I[0] +\r
+                       (unsigned int) I[1] * 100;\r
+               *eaten =\r
+                       ((unsigned int) I[2]) +\r
+                       ((unsigned int) I[3] << 8) +\r
+                       ((unsigned int) I[4] << 16) +\r
+                       ((unsigned int) I[5] << 24);\r
                I += 6;\r
        }\r
 \r