summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorDylan Baker <[email protected]>2018-09-14 12:57:32 -0700
committerDylan Baker <[email protected]>2020-04-21 11:09:04 -0700
commit8e3696137f2cb7b4f5a3824f26186ecbb06f9282 (patch)
tree4494df8d138aaf2bab2feafa832f68e9fdf9bfb1 /src/util
parent289f02d1d5990e052e21eb250f6d40b47d6eb12f (diff)
remove final imports.h and imports.c bits
This moves the fi_types to a new mesa_private.h and removes the imports.c file. The vast majority of this patch is just removing pound includes of imports.h and fixing up the recursive includes. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/Makefile.sources2
-rw-r--r--src/util/imports.c62
-rw-r--r--src/util/imports.h67
-rw-r--r--src/util/meson.build2
-rw-r--r--src/util/register_allocate.c4
5 files changed, 2 insertions, 135 deletions
diff --git a/src/util/Makefile.sources b/src/util/Makefile.sources
index 0e8fbb7ee85..95e2f788c1e 100644
--- a/src/util/Makefile.sources
+++ b/src/util/Makefile.sources
@@ -51,8 +51,6 @@ MESA_UTIL_FILES := \
half_float.h \
hash_table.c \
hash_table.h \
- imports.c \
- imports.h \
list.h \
macros.h \
mesa-sha1.c \
diff --git a/src/util/imports.c b/src/util/imports.c
deleted file mode 100644
index 776e86efb7a..00000000000
--- a/src/util/imports.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * \file imports.c
- * Standard C library function wrappers.
- *
- * Imports are services which the device driver or window system or
- * operating system provides to the core renderer. The core renderer (Mesa)
- * will call these functions in order to do memory allocation, simple I/O,
- * etc.
- *
- * Some drivers will want to override/replace this file with something
- * specialized, but that'll be rare.
- *
- * Eventually, I want to move roll the glheader.h file into this.
- *
- * \todo Functions still needed:
- * - scanf
- * - qsort
- * - rand and RAND_MAX
- */
-
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * 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 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 <stdarg.h>
-#include "c99_math.h"
-#include "imports.h"
-
-#ifdef _GNU_SOURCE
-#include <locale.h>
-#ifdef __APPLE__
-#include <xlocale.h>
-#endif
-#endif
-
-
-#ifdef _WIN32
-#define vsnprintf _vsnprintf
-#elif defined(__IBMC__) || defined(__IBMCPP__)
-extern int vsnprintf(char *str, size_t count, const char *fmt, va_list arg);
-#endif
diff --git a/src/util/imports.h b/src/util/imports.h
deleted file mode 100644
index 345e9114aa3..00000000000
--- a/src/util/imports.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- *
- * 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 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.
- */
-
-
-/**
- * \file imports.h
- * Standard C library function wrappers.
- *
- * This file provides wrappers for all the standard C library functions
- * like malloc(), free(), printf(), getenv(), etc.
- */
-
-
-#ifndef IMPORTS_H
-#define IMPORTS_H
-
-
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include "util/compiler.h"
-#include "util/bitscan.h"
-#include "util/u_memory.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**
- * Sometimes we treat floats as ints. On x86 systems, moving a float
- * as an int (thereby using integer registers instead of FP registers) is
- * a performance win. Typically, this can be done with ordinary casts.
- * But with gcc's -fstrict-aliasing flag (which defaults to on in gcc 3.0)
- * these casts generate warnings.
- * The following union typedef is used to solve that.
- */
-typedef union { float f; int i; unsigned u; } fi_type;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* IMPORTS_H */
diff --git a/src/util/meson.build b/src/util/meson.build
index ff25a9ea851..68ae31f421b 100644
--- a/src/util/meson.build
+++ b/src/util/meson.build
@@ -55,8 +55,6 @@ files_mesa_util = files(
'half_float.h',
'hash_table.c',
'hash_table.h',
- 'imports.c',
- 'imports.h',
'list.h',
'macros.h',
'mesa-sha1.c',
diff --git a/src/util/register_allocate.c b/src/util/register_allocate.c
index af43c2fbb43..faae56752cd 100644
--- a/src/util/register_allocate.c
+++ b/src/util/register_allocate.c
@@ -71,10 +71,10 @@
*/
#include <stdbool.h>
-#include <limits.h>
+#include <stdlib.h>
#include "ralloc.h"
-#include "util/imports.h"
+#include "main/macros.h"
#include "util/bitset.h"
#include "u_math.h"
#include "register_allocate.h"