[Mesa-dev] [PATCH 5/9] glsl: use the weak _mesa_error_no_memory() symbol

Emil Velikov emil.l.velikov at gmail.com
Wed Apr 15 07:08:06 PDT 2015


Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 src/glsl/Makefile.am    | 13 ++++---------
 src/glsl/SConscript     |  2 +-
 src/glsl/main.cpp       |  6 ------
 src/glsl/tests/common.c | 30 ------------------------------
 4 files changed, 5 insertions(+), 46 deletions(-)
 delete mode 100644 src/glsl/tests/common.c

diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
index 23c6fe8..cd37e64 100644
--- a/src/glsl/Makefile.am
+++ b/src/glsl/Makefile.am
@@ -89,8 +89,7 @@ tests_general_ir_test_SOURCES =		\
 	tests/builtin_variable_test.cpp			\
 	tests/invalidate_locations_test.cpp		\
 	tests/general_ir_test.cpp			\
-	tests/varyings_test.cpp				\
-	tests/common.c
+	tests/varyings_test.cpp
 tests_general_ir_test_CFLAGS =				\
 	$(PTHREAD_CFLAGS)
 tests_general_ir_test_LDADD =				\
@@ -103,8 +102,7 @@ tests_uniform_initializer_test_SOURCES =		\
 	tests/copy_constant_to_storage_tests.cpp	\
 	tests/set_uniform_initializer_tests.cpp		\
 	tests/uniform_initializer_utils.cpp		\
-	tests/uniform_initializer_utils.h		\
-	tests/common.c
+	tests/uniform_initializer_utils.h
 tests_uniform_initializer_test_CFLAGS =			\
 	$(PTHREAD_CFLAGS)
 tests_uniform_initializer_test_LDADD =			\
@@ -114,8 +112,7 @@ tests_uniform_initializer_test_LDADD =			\
 	$(PTHREAD_LIBS)
 
 tests_sampler_types_test_SOURCES =			\
-	tests/sampler_types_test.cpp			\
-	tests/common.c
+	tests/sampler_types_test.cpp
 tests_sampler_types_test_CFLAGS =			\
 	$(PTHREAD_CFLAGS)
 tests_sampler_types_test_LDADD =			\
@@ -133,8 +130,7 @@ libglcpp_la_SOURCES =					\
 	$(LIBGLCPP_FILES)
 
 glcpp_glcpp_SOURCES =					\
-	glcpp/glcpp.c					\
-	tests/common.c
+	glcpp/glcpp.c
 glcpp_glcpp_LDADD =					\
 	libglcpp.la					\
 	$(top_builddir)/src/libglsl_util.la		\
@@ -164,7 +160,6 @@ glsl_compiler_LDADD =					\
 
 glsl_test_SOURCES = \
 	standalone_scaffolding.cpp \
-	tests/common.c \
 	test.cpp \
 	test_optpass.cpp \
 	test_optpass.h
diff --git a/src/glsl/SConscript b/src/glsl/SConscript
index d18a8a7..455f5e8 100644
--- a/src/glsl/SConscript
+++ b/src/glsl/SConscript
@@ -117,6 +117,6 @@ env.Alias('glsl_compiler', glsl_compiler)
 
 glcpp = env.Program(
     target = 'glcpp/glcpp',
-    source = ['glcpp/glcpp.c', 'tests/common.c'] + mesa_objs,
+    source = ['glcpp/glcpp.c'] + mesa_objs,
 )
 env.Alias('glcpp', glcpp)
diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
index ccac839..fc54ddd 100644
--- a/src/glsl/main.cpp
+++ b/src/glsl/main.cpp
@@ -41,12 +41,6 @@
 
 static int glsl_version = 330;
 
-extern "C" void
-_mesa_error_no_memory(const char *caller)
-{
-   fprintf(stderr, "Mesa error: out of memory in %s", caller);
-}
-
 static void
 initialize_context(struct gl_context *ctx, gl_api api)
 {
diff --git a/src/glsl/tests/common.c b/src/glsl/tests/common.c
deleted file mode 100644
index d69f54d..0000000
--- a/src/glsl/tests/common.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright © 2014 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-#include <stdio.h>
-#include "main/errors.h"
-
-void
-_mesa_error_no_memory(const char *caller)
-{
-   fprintf(stderr, "Mesa error: out of memory in %s", caller);
-}
-- 
2.3.5



More information about the mesa-dev mailing list