glsl: Add using statements for standard library functions.
Standard library functions in C++ are in the std namespace. When using C++-style header files for the standard library, some compilers, such as Sun Studio, provide symbols only for the std namespace and not for the global namespace. This patch adds using statements for standard library functions. Another option could have been to prepend standard library function calls with 'std::'. This patch fixes several compilation errors with Sun Studio.
This commit is contained in:
@@ -24,6 +24,8 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include "ast.h"
|
#include "ast.h"
|
||||||
|
|
||||||
|
using std::printf;
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
ast_expression::operator_string(enum ast_operators op)
|
ast_expression::operator_string(enum ast_operators op)
|
||||||
{
|
{
|
||||||
|
@@ -27,6 +27,8 @@ extern "C" {
|
|||||||
#include "program/symbol_table.h"
|
#include "program/symbol_table.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using std::printf;
|
||||||
|
|
||||||
void
|
void
|
||||||
ast_type_specifier::print(void) const
|
ast_type_specifier::print(void) const
|
||||||
{
|
{
|
||||||
|
@@ -27,6 +27,8 @@
|
|||||||
#include "ast.h"
|
#include "ast.h"
|
||||||
#include "glsl_types.h"
|
#include "glsl_types.h"
|
||||||
|
|
||||||
|
using std::strcmp;
|
||||||
|
|
||||||
ir_rvalue *
|
ir_rvalue *
|
||||||
_mesa_ast_field_selection_to_hir(const ast_expression *expr,
|
_mesa_ast_field_selection_to_hir(const ast_expression *expr,
|
||||||
exec_list *instructions,
|
exec_list *instructions,
|
||||||
|
@@ -25,6 +25,9 @@
|
|||||||
#include "glsl_types.h"
|
#include "glsl_types.h"
|
||||||
#include "glsl_parser_extras.h"
|
#include "glsl_parser_extras.h"
|
||||||
|
|
||||||
|
using std::printf;
|
||||||
|
using std::strncmp;
|
||||||
|
|
||||||
static void print_type(const glsl_type *t);
|
static void print_type(const glsl_type *t);
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -39,6 +39,9 @@
|
|||||||
#include "program/hash_table.h"
|
#include "program/hash_table.h"
|
||||||
#include "glsl_types.h"
|
#include "glsl_types.h"
|
||||||
|
|
||||||
|
using std::abort;
|
||||||
|
using std::printf;
|
||||||
|
|
||||||
class ir_validate : public ir_hierarchical_visitor {
|
class ir_validate : public ir_hierarchical_visitor {
|
||||||
public:
|
public:
|
||||||
ir_validate()
|
ir_validate()
|
||||||
|
@@ -35,6 +35,9 @@
|
|||||||
#include "ir_expression_flattening.h"
|
#include "ir_expression_flattening.h"
|
||||||
#include "glsl_types.h"
|
#include "glsl_types.h"
|
||||||
|
|
||||||
|
using std::abort;
|
||||||
|
using std::printf;
|
||||||
|
|
||||||
class ir_mat_op_to_vec_visitor : public ir_hierarchical_visitor {
|
class ir_mat_op_to_vec_visitor : public ir_hierarchical_visitor {
|
||||||
public:
|
public:
|
||||||
ir_mat_op_to_vec_visitor()
|
ir_mat_op_to_vec_visitor()
|
||||||
|
@@ -41,6 +41,8 @@
|
|||||||
#include "ir_optimization.h"
|
#include "ir_optimization.h"
|
||||||
#include "glsl_types.h"
|
#include "glsl_types.h"
|
||||||
|
|
||||||
|
using std::memset;
|
||||||
|
|
||||||
class acp_entry : public exec_node
|
class acp_entry : public exec_node
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@@ -37,6 +37,9 @@
|
|||||||
#include "ir_optimization.h"
|
#include "ir_optimization.h"
|
||||||
#include "glsl_types.h"
|
#include "glsl_types.h"
|
||||||
|
|
||||||
|
using std::calloc;
|
||||||
|
using std::free;
|
||||||
|
|
||||||
struct assignment_entry {
|
struct assignment_entry {
|
||||||
exec_node link;
|
exec_node link;
|
||||||
int assignment_count;
|
int assignment_count;
|
||||||
|
@@ -32,6 +32,8 @@
|
|||||||
#include "ir_variable_refcount.h"
|
#include "ir_variable_refcount.h"
|
||||||
#include "glsl_types.h"
|
#include "glsl_types.h"
|
||||||
|
|
||||||
|
using std::printf;
|
||||||
|
|
||||||
static bool debug = false;
|
static bool debug = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -38,6 +38,8 @@
|
|||||||
#include "ir_optimization.h"
|
#include "ir_optimization.h"
|
||||||
#include "glsl_types.h"
|
#include "glsl_types.h"
|
||||||
|
|
||||||
|
using std::printf;
|
||||||
|
|
||||||
static bool debug = false;
|
static bool debug = false;
|
||||||
|
|
||||||
class assignment_entry : public exec_node
|
class assignment_entry : public exec_node
|
||||||
|
@@ -32,6 +32,8 @@
|
|||||||
#include "ir_expression_flattening.h"
|
#include "ir_expression_flattening.h"
|
||||||
#include "glsl_types.h"
|
#include "glsl_types.h"
|
||||||
|
|
||||||
|
using std::strcmp;
|
||||||
|
|
||||||
class signature_entry : public exec_node
|
class signature_entry : public exec_node
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@@ -38,6 +38,9 @@
|
|||||||
#include "ir_rvalue_visitor.h"
|
#include "ir_rvalue_visitor.h"
|
||||||
#include "glsl_types.h"
|
#include "glsl_types.h"
|
||||||
|
|
||||||
|
using std::printf;
|
||||||
|
using std::strcmp;
|
||||||
|
|
||||||
static bool debug = false;
|
static bool debug = false;
|
||||||
|
|
||||||
// XXX using variable_entry2 here to avoid collision (MSVC multiply-defined
|
// XXX using variable_entry2 here to avoid collision (MSVC multiply-defined
|
||||||
|
@@ -32,6 +32,8 @@
|
|||||||
#include "ir_optimization.h"
|
#include "ir_optimization.h"
|
||||||
#include "glsl_types.h"
|
#include "glsl_types.h"
|
||||||
|
|
||||||
|
using std::memset;
|
||||||
|
|
||||||
class ir_swizzle_swizzle_visitor : public ir_hierarchical_visitor {
|
class ir_swizzle_swizzle_visitor : public ir_hierarchical_visitor {
|
||||||
public:
|
public:
|
||||||
ir_swizzle_swizzle_visitor()
|
ir_swizzle_swizzle_visitor()
|
||||||
|
@@ -54,6 +54,8 @@
|
|||||||
#include "ir_optimization.h"
|
#include "ir_optimization.h"
|
||||||
#include "glsl_types.h"
|
#include "glsl_types.h"
|
||||||
|
|
||||||
|
using std::printf;
|
||||||
|
|
||||||
static bool debug = false;
|
static bool debug = false;
|
||||||
|
|
||||||
class ir_tree_grafting_visitor : public ir_hierarchical_visitor {
|
class ir_tree_grafting_visitor : public ir_hierarchical_visitor {
|
||||||
|
Reference in New Issue
Block a user