Commit d5b18a78 by Nicolas Capens Committed by Nicolas Capens

Fix the Linux build.

Change-Id: I2c06dbe89f8e079f690242cd97af6638087af593 Reviewed-on: https://swiftshader-review.googlesource.com/1394Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 2bae3ed2
......@@ -20,6 +20,10 @@ using namespace std;
#include <stdarg.h>
#include <ctype.h>
#if defined(__unix__)
#include <unistd.h>
#endif
namespace sw
{
Configurator::Configurator(string iniPath)
......
......@@ -15,6 +15,9 @@
#include <dlfcn.h>
#endif
void *getLibraryHandle(const char *path);
void *loadLibrary(const char *path);
template<int n>
void *loadLibrary(const char *(&names)[n])
{
......@@ -71,7 +74,7 @@ void *loadLibrary(const char *(&names)[n])
inline void *getLibraryHandle(const char *path)
{
bool resident = (dlopen(names[i], RTLD_NOLOAD) != 0);
bool resident = (dlopen(path, RTLD_NOLOAD) != 0);
if(resident)
{
......
......@@ -424,7 +424,7 @@ public:
/// @returns the all-ones value for an APInt of the specified bit-width.
/// @brief Get the all-ones value.
static APInt getAllOnesValue(unsigned numBits) {
return APInt(numBits, _UI64_MAX, true);
return APInt(numBits, ~0ULL, true);
}
/// @returns the '0' value for an APInt of the specified bit-width.
......@@ -495,7 +495,7 @@ public:
if (loBitsSet == 0)
return APInt(numBits, 0);
if (loBitsSet == APINT_BITS_PER_WORD)
return APInt(numBits, _UI64_MAX);
return APInt(numBits, ~0ULL);
// For small values, return quickly.
if (numBits < APINT_BITS_PER_WORD)
return APInt(numBits, (1ULL << loBitsSet) - 1);
......@@ -1062,11 +1062,11 @@ public:
/// @brief Set every bit to 1.
void setAllBits() {
if (isSingleWord())
VAL = _UI64_MAX;
VAL = ~0ULL;
else {
// Set all the bits in all the words.
for (unsigned i = 0; i < getNumWords(); ++i)
pVal[i] = _UI64_MAX;
pVal[i] = ~0ULL;
}
// Clear the unused ones
clearUnusedBits();
......@@ -1091,10 +1091,10 @@ public:
/// @brief Toggle every bit to its opposite value.
void flipAllBits() {
if (isSingleWord())
VAL ^= _UI64_MAX;
VAL ^= ~0ULL;
else {
for (unsigned i = 0; i < getNumWords(); ++i)
pVal[i] ^= _UI64_MAX;
pVal[i] ^= ~0ULL;
}
clearUnusedBits();
}
......
......@@ -40,12 +40,12 @@ public:
return height;
}
GLenum Image::getFormat()
GLenum getFormat()
{
return format;
}
GLenum Image::getType()
GLenum getType()
{
return type;
}
......@@ -100,7 +100,7 @@ public:
virtual void loadCompressedData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels) = 0;
protected:
virtual ~Image() = 0
virtual ~Image()
{
}
......
......@@ -7,7 +7,7 @@
<Option compiler="gcc" />
<Build>
<Target title="Debug x86">
<Option output="./../../bin/x86/Debug/libEGL.so.1" prefix_auto="0" extension_auto="0" />
<Option output="./../../../lib/Debug_x86/libEGL.so.1" prefix_auto="0" extension_auto="0" />
<Option object_output="obj/x86/Debug/" />
<Option type="3" />
<Option compiler="gcc" />
......@@ -22,7 +22,7 @@
</Linker>
</Target>
<Target title="Release x86">
<Option output="./../../bin/x86/Release/libEGL.so.1" prefix_auto="0" extension_auto="0" />
<Option output="./../../../lib/Release_x86/libEGL.so.1" prefix_auto="0" extension_auto="0" />
<Option object_output="obj/x86/Release/" />
<Option type="3" />
<Option compiler="gcc" />
......@@ -40,7 +40,7 @@
</Linker>
</Target>
<Target title="Debug x64">
<Option output="./../../bin/x64/Debug/libEGL.so.1" prefix_auto="0" extension_auto="0" />
<Option output="./../../../lib/Debug_x64/libEGL.so.1" prefix_auto="0" extension_auto="0" />
<Option object_output="obj/x64/Debug/" />
<Option type="3" />
<Option compiler="gcc" />
......@@ -56,7 +56,7 @@
</Linker>
</Target>
<Target title="Release x64">
<Option output="./../../bin/x64/Release/libEGL.so.1" prefix_auto="0" extension_auto="0" />
<Option output="./../../../lib/Release_x64/libEGL.so.1" prefix_auto="0" extension_auto="0" />
<Option object_output="obj/x64/Release/" />
<Option type="3" />
<Option compiler="gcc" />
......@@ -86,16 +86,18 @@
<Linker>
<Add library="pthread" />
</Linker>
<Unit filename="../../Common/SharedLibrary.hpp" />
<Unit filename="../common/debug.cpp" />
<Unit filename="./Config.cpp" />
<Unit filename="./Config.h" />
<Unit filename="./Display.cpp" />
<Unit filename="./Display.h" />
<Unit filename="./Surface.cpp" />
<Unit filename="./Surface.h" />
<Unit filename="./libEGL.cpp" />
<Unit filename="./main.cpp" />
<Unit filename="./main.h" />
<Unit filename="Config.cpp" />
<Unit filename="Config.h" />
<Unit filename="Display.cpp" />
<Unit filename="Display.h" />
<Unit filename="Image.hpp" />
<Unit filename="Surface.cpp" />
<Unit filename="Surface.h" />
<Unit filename="libEGL.cpp" />
<Unit filename="main.cpp" />
<Unit filename="main.h" />
<Extensions>
<code_completion />
<debugger />
......
......@@ -21,6 +21,7 @@
#include "Common/Version.h"
#include <exception>
#include <string.h>
static bool validateDisplay(egl::Display *display)
{
......
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_workspace_file>
<Workspace title="SwiftShader">
<Project filename="./GLES2/libEGL/libEGL.cbp" />
<Project filename="./GLES2/libGLESv2/libGLESv2.cbp">
<Project filename="./OpenGL/libEGL/libEGL.cbp" />
<Project filename="./OpenGL/libGLESv2/libGLESv2.cbp">
<Depends filename="./LLVM/LLVM.cbp" />
</Project>
<Project filename="./LLVM/LLVM.cbp" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment