diff --git a/CMakeLists.txt b/CMakeLists.txt index c19c0da939..960d4b3a2d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -442,6 +442,8 @@ add_library(Common STATIC Common/Crypto/sha256.h Common/BitScan.h Common/BitSet.h + Common/Buffer.h + Common/Buffer.cpp Common/ByteSwap.h Common/CodeBlock.h Common/ColorConv.cpp @@ -949,8 +951,6 @@ endif() add_library(native STATIC ${nativeExtra} - ext/native/base/buffer.cpp - ext/native/base/buffer.h ext/native/base/colorutil.cpp ext/native/base/colorutil.h ext/native/base/display.cpp diff --git a/ext/native/base/buffer.cpp b/Common/Buffer.cpp similarity index 99% rename from ext/native/base/buffer.cpp rename to Common/Buffer.cpp index 9598dcbe00..78302f60fe 100644 --- a/ext/native/base/buffer.cpp +++ b/Common/Buffer.cpp @@ -1,4 +1,3 @@ -#include "base/buffer.h" #include #include @@ -18,9 +17,10 @@ #define MSG_NOSIGNAL 0x00 #endif -#include "Common/TimeUtil.h" #include "file/fd_util.h" +#include "Common/TimeUtil.h" +#include "Common/Buffer.h" #include "Common/Log.h" Buffer::Buffer() { } diff --git a/ext/native/base/buffer.h b/Common/Buffer.h similarity index 100% rename from ext/native/base/buffer.h rename to Common/Buffer.h diff --git a/Common/Common.vcxproj b/Common/Common.vcxproj index ca391d93ad..7be07259f0 100644 --- a/Common/Common.vcxproj +++ b/Common/Common.vcxproj @@ -354,6 +354,7 @@ + @@ -441,6 +442,7 @@ false + true true diff --git a/Common/Common.vcxproj.filters b/Common/Common.vcxproj.filters index 404207aacb..2e61356786 100644 --- a/Common/Common.vcxproj.filters +++ b/Common/Common.vcxproj.filters @@ -95,6 +95,7 @@ + @@ -162,6 +163,7 @@ + diff --git a/Common/StringUtils.cpp b/Common/StringUtils.cpp index b5a2d3b987..e812bad1b6 100644 --- a/Common/StringUtils.cpp +++ b/Common/StringUtils.cpp @@ -41,10 +41,9 @@ #include #include -#include "base/buffer.h" - -#include "Common.h" -#include "StringUtils.h" +#include "Common/Common.h" +#include "Common/Buffer.h" +#include "Common/StringUtils.h" void truncate_cpy(char *dest, size_t destSize, const char *src) { size_t len = strlen(src); diff --git a/Core/Reporting.cpp b/Core/Reporting.cpp index 36bac97703..6d6e364834 100644 --- a/Core/Reporting.cpp +++ b/Core/Reporting.cpp @@ -48,7 +48,6 @@ #include "net/resolve.h" #include "net/url.h" -#include "base/buffer.h" #include "thread/threadutil.h" #include "file/zip_read.h" diff --git a/android/jni/Android.mk b/android/jni/Android.mk index a87e755684..3060d22e87 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -204,6 +204,7 @@ EXEC_AND_LIB_FILES := \ $(SRC)/ext/udis86/udis86.c \ $(SRC)/ext/xbrz/xbrz.cpp \ $(SRC)/ext/xxhash.c \ + $(SRC)/Common/Buffer.cpp \ $(SRC)/Common/Crypto/md5.cpp \ $(SRC)/Common/Crypto/sha1.cpp \ $(SRC)/Common/Crypto/sha256.cpp \ diff --git a/ext/native/Android.mk b/ext/native/Android.mk index fc41991fd9..754edf4b69 100644 --- a/ext/native/Android.mk +++ b/ext/native/Android.mk @@ -7,7 +7,6 @@ include $(CLEAR_VARS) LOCAL_MODULE := libnative LOCAL_ARM_MODE := arm LOCAL_SRC_FILES :=\ - base/buffer.cpp \ base/display.cpp \ base/colorutil.cpp \ data/base64.cpp \ diff --git a/ext/native/native.vcxproj b/ext/native/native.vcxproj index 87ca54c357..275ac87058 100644 --- a/ext/native/native.vcxproj +++ b/ext/native/native.vcxproj @@ -382,7 +382,6 @@ - @@ -484,7 +483,6 @@ - diff --git a/ext/native/native.vcxproj.filters b/ext/native/native.vcxproj.filters index 272e10769e..1542972251 100644 --- a/ext/native/native.vcxproj.filters +++ b/ext/native/native.vcxproj.filters @@ -104,9 +104,6 @@ net - - base - file @@ -400,9 +397,6 @@ net - - base - file diff --git a/ext/native/net/http_client.cpp b/ext/native/net/http_client.cpp index 4169c97123..24d93ed0c3 100644 --- a/ext/native/net/http_client.cpp +++ b/ext/native/net/http_client.cpp @@ -17,16 +17,16 @@ #endif #include -#include -#include +#include +#include -#include "base/buffer.h" #include "data/compression.h" #include "file/fd_util.h" #include "net/resolve.h" #include "net/url.h" #include "thread/threadutil.h" +#include "Common/Buffer.h" #include "Common/Log.h" namespace net { diff --git a/ext/native/net/http_client.h b/ext/native/net/http_client.h index be71cedcff..32490dc40b 100644 --- a/ext/native/net/http_client.h +++ b/ext/native/net/http_client.h @@ -5,7 +5,6 @@ #include #include -#include "base/buffer.h" #include "net/resolve.h" #ifdef _WIN32 @@ -21,6 +20,8 @@ #include #endif +#include "Common/Buffer.h" + namespace net { class Connection { diff --git a/ext/native/net/http_headers.h b/ext/native/net/http_headers.h index 470f589972..0ee0b1b751 100644 --- a/ext/native/net/http_headers.h +++ b/ext/native/net/http_headers.h @@ -1,9 +1,9 @@ -#ifndef _NET_HTTP_HTTP_HEADERS -#define _NET_HTTP_HTTP_HEADERS +#pragma once #include #include -#include "base/buffer.h" + +#include "Common/Buffer.h" namespace net { class InputSink; @@ -48,5 +48,3 @@ class RequestHeader { }; } // namespace http - -#endif diff --git a/ext/native/net/http_server.cpp b/ext/native/net/http_server.cpp index e509ee7c0b..738b536f87 100644 --- a/ext/native/net/http_server.cpp +++ b/ext/native/net/http_server.cpp @@ -34,12 +34,12 @@ #include #include -#include "base/buffer.h" #include "file/fd_util.h" #include "net/http_server.h" #include "net/sinks.h" #include "thread/executor.h" +#include "Common/Buffer.h" #include "Common/Log.h" namespace http { diff --git a/ext/native/net/http_server.h b/ext/native/net/http_server.h index 0b5dfbe668..5a8151b77d 100644 --- a/ext/native/net/http_server.h +++ b/ext/native/net/http_server.h @@ -1,10 +1,8 @@ -#ifndef _HTTP_SERVER_H -#define _HTTP_SERVER_H +#pragma once #include #include -#include "base/buffer.h" #include "net/http_headers.h" #include "net/resolve.h" #include "thread/executor.h" @@ -114,5 +112,3 @@ private: }; } // namespace http - -#endif // _HTTP_SERVER_H diff --git a/libretro/Makefile.common b/libretro/Makefile.common index eb0472bcbb..1d61dd6fcd 100644 --- a/libretro/Makefile.common +++ b/libretro/Makefile.common @@ -144,6 +144,7 @@ SOURCES_CXX += \ SOURCES_CXX += \ $(COMMONDIR)/Serialize/Serializer.cpp \ + $(COMMONDIR)/Common/Buffer.cpp \ $(COMMONDIR)/ConsoleListener.cpp \ $(COMMONDIR)/ExceptionHandlerSetup.cpp \ $(COMMONDIR)/FileUtil.cpp \ @@ -214,7 +215,6 @@ SOURCES_CXX += \ $(GPUDIR)/GLES/ShaderManagerGLES.cpp \ $(GPUDIR)/GLES/StateMappingGLES.cpp \ $(GPUDIR)/GLES/StencilBufferGLES.cpp \ - $(EXTDIR)/native/base/buffer.cpp \ $(EXTDIR)/native/base/colorutil.cpp \ $(EXTDIR)/native/base/display.cpp \ $(EXTDIR)/native/data/compression.cpp \