Mesa (7.9): Use C-style system headers in C++ code to avoid issues with std :: namespace

Ian Romanick idr at kemper.freedesktop.org
Mon Feb 21 23:07:12 UTC 2011


Module: Mesa
Branch: 7.9
Commit: 0f3a9643c62174028a74bd7bffdca6d745b2c743
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0f3a9643c62174028a74bd7bffdca6d745b2c743

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Mon Feb 21 13:18:05 2011 -0800

Use C-style system headers in C++ code to avoid issues with std:: namespace

Based on commit 497baf4e4a6a0a2f247c7bfb9bf69a2b93c2c19f from master.

---

 src/glsl/ast_expr.cpp             |    4 ++--
 src/glsl/ast_type.cpp             |    2 +-
 src/glsl/glsl_parser_extras.h     |    2 +-
 src/glsl/glsl_types.cpp           |    2 +-
 src/glsl/glsl_types.h             |    4 ++--
 src/glsl/ir.h                     |    4 ++--
 src/glsl/ir_import_prototypes.cpp |    2 +-
 src/glsl/ir_reader.cpp            |    2 +-
 src/glsl/link_functions.cpp       |    6 +++---
 src/glsl/linker.cpp               |    8 ++++----
 src/glsl/loop_controls.cpp        |    2 +-
 src/glsl/main.cpp                 |    4 ++--
 src/glsl/s_expression.cpp         |    6 +++---
 13 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/src/glsl/ast_expr.cpp b/src/glsl/ast_expr.cpp
index 4e83dec..7e0c7bd 100644
--- a/src/glsl/ast_expr.cpp
+++ b/src/glsl/ast_expr.cpp
@@ -20,8 +20,8 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
-#include <cstdio>
-#include <cassert>
+#include <stdio.h>
+#include <assert.h>
 #include "ast.h"
 
 const char *
diff --git a/src/glsl/ast_type.cpp b/src/glsl/ast_type.cpp
index 583f24b..d5e6613 100644
--- a/src/glsl/ast_type.cpp
+++ b/src/glsl/ast_type.cpp
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include <cstdio>
+#include <stdio.h>
 #include "ast.h"
 extern "C" {
 #include "program/symbol_table.h"
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index 8ba9173..af6c6b6 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -31,7 +31,7 @@
 #ifdef __cplusplus
 
 
-#include <cstdlib>
+#include <stdlib.h>
 #include "glsl_symbol_table.h"
 
 enum _mesa_glsl_parser_targets {
diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
index 2eaaf28..765e920 100644
--- a/src/glsl/glsl_types.cpp
+++ b/src/glsl/glsl_types.cpp
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include <cstdio>
+#include <stdio.h>
 #include <stdlib.h>
 #include "main/core.h" /* for Elements */
 #include "glsl_symbol_table.h"
diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h
index 878e819..e55b1ff 100644
--- a/src/glsl/glsl_types.h
+++ b/src/glsl/glsl_types.h
@@ -26,8 +26,8 @@
 #ifndef GLSL_TYPES_H
 #define GLSL_TYPES_H
 
-#include <cstring>
-#include <cassert>
+#include <string.h>
+#include <assert.h>
 
 extern "C" {
 #include "GL/gl.h"
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 19a5d24..3b949e8 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -26,8 +26,8 @@
 #ifndef IR_H
 #define IR_H
 
-#include <cstdio>
-#include <cstdlib>
+#include <stdio.h>
+#include <stdlib.h>
 
 #include "ralloc.h"
 #include "list.h"
diff --git a/src/glsl/ir_import_prototypes.cpp b/src/glsl/ir_import_prototypes.cpp
index 272c926..ed8a99a 100644
--- a/src/glsl/ir_import_prototypes.cpp
+++ b/src/glsl/ir_import_prototypes.cpp
@@ -27,7 +27,7 @@
  *
  * \author Ian Romanick
  */
-#include <cstdio>
+#include <stdio.h>
 #include "ir.h"
 #include "glsl_symbol_table.h"
 
diff --git a/src/glsl/ir_reader.cpp b/src/glsl/ir_reader.cpp
index 6d5c87c..b37ef87 100644
--- a/src/glsl/ir_reader.cpp
+++ b/src/glsl/ir_reader.cpp
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include <cstdarg>
+#include <stdarg.h>
 
 #include "ir_reader.h"
 #include "glsl_parser_extras.h"
diff --git a/src/glsl/link_functions.cpp b/src/glsl/link_functions.cpp
index 5bbc921..0305b46 100644
--- a/src/glsl/link_functions.cpp
+++ b/src/glsl/link_functions.cpp
@@ -21,9 +21,9 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include <cstdlib>
-#include <cstdio>
-#include <cstdarg>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
 
 #include "main/core.h"
 #include "glsl_symbol_table.h"
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index f266df5..5eb4c6d 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -63,10 +63,10 @@
  *
  * \author Ian Romanick <ian.d.romanick at intel.com>
  */
-#include <cstdlib>
-#include <cstdio>
-#include <cstdarg>
-#include <climits>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <limits.h>
 
 #include "main/core.h"
 #include "glsl_symbol_table.h"
diff --git a/src/glsl/loop_controls.cpp b/src/glsl/loop_controls.cpp
index 9eaa50f..9acbadc 100644
--- a/src/glsl/loop_controls.cpp
+++ b/src/glsl/loop_controls.cpp
@@ -21,7 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include <climits>
+#include <limits.h>
 #include "main/compiler.h"
 #include "glsl_types.h"
 #include "loop_analysis.h"
diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
index 8543e20..ea26886 100644
--- a/src/glsl/main.cpp
+++ b/src/glsl/main.cpp
@@ -20,8 +20,8 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
-#include <cstdlib>
-#include <cstdio>
+#include <stdlib.h>
+#include <stdio.h>
 #include <getopt.h>
 
 #include <sys/types.h>
diff --git a/src/glsl/s_expression.cpp b/src/glsl/s_expression.cpp
index 2ec3c45..c95c4e7 100644
--- a/src/glsl/s_expression.cpp
+++ b/src/glsl/s_expression.cpp
@@ -22,9 +22,9 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <assert.h>
 #include "s_expression.h"
 




More information about the mesa-commit mailing list