Permalink
Browse files

Merge pull request #7376 from lioncash/sfml

 Externals: Update SFML to 2.5.0
  • Loading branch information...
delroth committed Aug 28, 2018
2 parents df93bb8 + d10a0b4 commit 2033d660d238d9f8f3c4af5acca3a1fec10ac57c
Showing with 1,159 additions and 303 deletions.
  1. +1 −0 Externals/SFML/build/vc2010/SFML_Network.vcxproj
  2. +1 −0 Externals/SFML/build/vc2010/SFML_Network.vcxproj.filters
  3. +90 −13 Externals/SFML/include/SFML/Config.hpp
  4. +3 −1 Externals/SFML/include/SFML/Network.hpp
  5. +1 −1 Externals/SFML/include/SFML/Network/Export.hpp
  6. +37 −22 Externals/SFML/include/SFML/Network/Http.hpp
  7. +16 −4 Externals/SFML/include/SFML/Network/IPAddress.hpp
  8. +134 −9 Externals/SFML/include/SFML/Network/Packet.hpp
  9. +6 −5 Externals/SFML/include/SFML/Network/Socket.hpp
  10. +1 −1 Externals/SFML/include/SFML/Network/SocketHandle.hpp
  11. +4 −4 Externals/SFML/include/SFML/Network/SocketSelector.hpp
  12. +13 −9 Externals/SFML/include/SFML/Network/TcpListener.hpp
  13. +28 −4 Externals/SFML/include/SFML/Network/TcpSocket.hpp
  14. +17 −9 Externals/SFML/include/SFML/Network/UdpSocket.hpp
  15. +4 −2 Externals/SFML/include/SFML/System.hpp
  16. +4 −2 Externals/SFML/include/SFML/System/Err.hpp
  17. +1 −1 Externals/SFML/include/SFML/System/Export.hpp
  18. +15 −5 Externals/SFML/include/SFML/System/NonCopyable.hpp
  19. +145 −19 Externals/SFML/include/SFML/System/String.hpp
  20. +53 −0 Externals/SFML/include/SFML/System/String.inl
  21. +40 −4 Externals/SFML/include/SFML/System/Time.hpp
  22. +5 −5 Externals/SFML/include/SFML/System/Utf.hpp
  23. +19 −19 Externals/SFML/include/SFML/System/Utf.inl
  24. +56 −17 Externals/SFML/src/SFML/Network/Http.cpp
  25. +67 −51 Externals/SFML/src/SFML/Network/IPAddress.cpp
  26. +92 −3 Externals/SFML/src/SFML/Network/Packet.cpp
  27. +9 −2 Externals/SFML/src/SFML/Network/Socket.cpp
  28. +1 −1 Externals/SFML/src/SFML/Network/SocketImpl.hpp
  29. +81 −17 Externals/SFML/src/SFML/Network/SocketSelector.cpp
  30. +12 −5 Externals/SFML/src/SFML/Network/TcpListener.cpp
  31. +46 −11 Externals/SFML/src/SFML/Network/TcpSocket.cpp
  32. +11 −4 Externals/SFML/src/SFML/Network/UdpSocket.cpp
  33. +24 −12 Externals/SFML/src/SFML/Network/Unix/SocketImpl.cpp
  34. +2 −2 Externals/SFML/src/SFML/Network/Unix/SocketImpl.hpp
  35. +11 −11 Externals/SFML/src/SFML/Network/Win32/SocketImpl.cpp
  36. +2 −2 Externals/SFML/src/SFML/Network/Win32/SocketImpl.hpp
  37. +4 −4 Externals/SFML/src/SFML/System/Err.cpp
  38. +66 −1 Externals/SFML/src/SFML/System/String.cpp
  39. +22 −1 Externals/SFML/src/SFML/System/Time.cpp
  40. +3 −8 Source/Core/Common/SFMLHelper.cpp
  41. +0 −1 Source/Core/Common/SFMLHelper.h
  42. +2 −2 Source/Core/Core/NetPlayClient.cpp
  43. +10 −9 Source/Core/Core/NetPlayServer.cpp
@@ -72,6 +72,7 @@
<ClInclude Include="..\..\include\SFML\System\Export.hpp" />
<ClInclude Include="..\..\include\SFML\System\NonCopyable.hpp" />
<ClInclude Include="..\..\include\SFML\System\String.hpp" />
<ClInclude Include="..\..\include\SFML\System\String.inl" />
<ClInclude Include="..\..\include\SFML\System\Time.hpp" />
<ClInclude Include="..\..\include\SFML\System\Utf.hpp" />
<ClInclude Include="..\..\include\SFML\System\Utf.inl" />
@@ -34,6 +34,7 @@
<ClInclude Include="..\..\include\SFML\System\Export.hpp" />
<ClInclude Include="..\..\include\SFML\System\NonCopyable.hpp" />
<ClInclude Include="..\..\include\SFML\System\String.hpp" />
<ClInclude Include="..\..\include\SFML\System\String.inl" />
<ClInclude Include="..\..\include\SFML\System\Time.hpp" />
<ClInclude Include="..\..\include\SFML\System\Utf.hpp" />
<ClInclude Include="..\..\include\SFML\System\Utf.inl" />
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
// Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -30,34 +30,73 @@
// Define the SFML version
////////////////////////////////////////////////////////////
#define SFML_VERSION_MAJOR 2
#define SFML_VERSION_MINOR 1
#define SFML_VERSION_MINOR 5
#define SFML_VERSION_PATCH 0
////////////////////////////////////////////////////////////
// Identify the operating system
// see http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system
////////////////////////////////////////////////////////////
#if defined(_WIN32) || defined(__WIN32__)
#if defined(_WIN32)
// Windows
#define SFML_SYSTEM_WINDOWS
#ifndef NOMINMAX
#define NOMINMAX
#endif
#elif defined(linux) || defined(__linux)
#elif defined(__APPLE__) && defined(__MACH__)
// Linux
#define SFML_SYSTEM_LINUX
// Apple platform, see which one it is
#include "TargetConditionals.h"
#elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
// MacOS
#define SFML_SYSTEM_MACOS
// iOS
#define SFML_SYSTEM_IOS
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#elif TARGET_OS_MAC
// FreeBSD
#define SFML_SYSTEM_FREEBSD
// MacOS
#define SFML_SYSTEM_MACOS
#else
// Unsupported Apple system
#error This Apple operating system is not supported by SFML library
#endif
#elif defined(__unix__)
// UNIX system, see which one it is
#if defined(__ANDROID__)
// Android
#define SFML_SYSTEM_ANDROID
#elif defined(__linux__)
// Linux
#define SFML_SYSTEM_LINUX
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
// FreeBSD
#define SFML_SYSTEM_FREEBSD
#elif defined(__OpenBSD__)
// OpenBSD
#define SFML_SYSTEM_OPENBSD
#else
// Unsupported UNIX system
#error This UNIX operating system is not supported by SFML library
#endif
#else
@@ -91,7 +130,7 @@
// For Visual C++ compilers, we also need to turn off this annoying C4251 warning
#ifdef _MSC_VER
#pragma warning(disable : 4251)
#pragma warning(disable: 4251)
#endif
@@ -123,6 +162,44 @@
#endif
////////////////////////////////////////////////////////////
// Cross-platform warning for deprecated functions and classes
//
// Usage:
// class SFML_DEPRECATED MyClass
// {
// SFML_DEPRECATED void memberFunc();
// };
//
// SFML_DEPRECATED void globalFunc();
////////////////////////////////////////////////////////////
#if defined(SFML_NO_DEPRECATED_WARNINGS)
// User explicitly requests to disable deprecation warnings
#define SFML_DEPRECATED
#elif defined(_MSC_VER)
// Microsoft C++ compiler
// Note: On newer MSVC versions, using deprecated functions causes a compiler error. In order to
// trigger a warning instead of an error, the compiler flag /sdl- (instead of /sdl) must be specified.
#define SFML_DEPRECATED __declspec(deprecated)
#elif defined(__GNUC__)
// g++ and Clang
#define SFML_DEPRECATED __attribute__ ((deprecated))
#else
// Other compilers are not supported, leave class or function as-is.
// With a bit of luck, the #pragma directive works, otherwise users get a warning (no error!) for unrecognized #pragma.
#pragma message("SFML_DEPRECATED is not supported for your compiler, please contact the SFML team")
#define SFML_DEPRECATED
#endif
////////////////////////////////////////////////////////////
// Define portable fixed-size types
////////////////////////////////////////////////////////////
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
// Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -36,6 +36,8 @@
// This file is "IpAddress.hpp" upstream
#include <SFML/Network/IPAddress.hpp>
#include <SFML/Network/Packet.hpp>
#include <SFML/Network/Socket.hpp>
#include <SFML/Network/SocketHandle.hpp>
#include <SFML/Network/SocketSelector.hpp>
#include <SFML/Network/TcpListener.hpp>
#include <SFML/Network/TcpSocket.hpp>
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
// Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
// Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -45,25 +45,27 @@ namespace sf
////////////////////////////////////////////////////////////
class SFML_NETWORK_API Http : NonCopyable
{
public :
public:
////////////////////////////////////////////////////////////
/// \brief Define a HTTP request
///
////////////////////////////////////////////////////////////
class SFML_NETWORK_API Request
{
public :
public:
////////////////////////////////////////////////////////////
/// \brief Enumerate the available HTTP methods for a request
///
////////////////////////////////////////////////////////////
enum Method
{
Get, ///< Request in get mode, standard method to retrieve a page
Post, ///< Request in post mode, usually to send data to a page
Head ///< Request a page's header only
Get, ///< Request in get mode, standard method to retrieve a page
Post, ///< Request in post mode, usually to send data to a page
Head, ///< Request a page's header only
Put, ///< Request in put mode, useful for a REST API
Delete ///< Request in delete mode, useful for a REST API
};
////////////////////////////////////////////////////////////
@@ -83,7 +85,7 @@ public :
/// \brief Set the value of a field
///
/// The field is created if it doesn't exist. The name of
/// the field is case insensitive.
/// the field is case-insensitive.
/// By default, a request doesn't contain any field (but the
/// mandatory fields are added later by the HTTP client when
/// sending the request).
@@ -141,7 +143,7 @@ public :
////////////////////////////////////////////////////////////
void setBody(const std::string& body);
private :
private:
friend class Http;
@@ -190,7 +192,7 @@ public :
////////////////////////////////////////////////////////////
class SFML_NETWORK_API Response
{
public :
public:
////////////////////////////////////////////////////////////
/// \brief Enumerate all the valid status codes for a response
@@ -210,12 +212,12 @@ public :
MultipleChoices = 300, ///< The requested page can be accessed from several locations
MovedPermanently = 301, ///< The requested page has permanently moved to a new location
MovedTemporarily = 302, ///< The requested page has temporarily moved to a new location
NotModified = 304, ///< For conditionnal requests, means the requested page hasn't changed and doesn't need to be refreshed
NotModified = 304, ///< For conditional requests, means the requested page hasn't changed and doesn't need to be refreshed
// 4xx: client error
BadRequest = 400, ///< The server couldn't understand the request (syntax error)
Unauthorized = 401, ///< The requested page needs an authentification to be accessed
Forbidden = 403, ///< The requested page cannot be accessed at all, even with authentification
Unauthorized = 401, ///< The requested page needs an authentication to be accessed
Forbidden = 403, ///< The requested page cannot be accessed at all, even with authentication
NotFound = 404, ///< The requested page doesn't exist
RangeNotSatisfiable = 407, ///< The server can't satisfy the partial GET request (with a "Range" header field)
@@ -301,7 +303,7 @@ public :
////////////////////////////////////////////////////////////
const std::string& getBody() const;
private :
private:
friend class Http;
@@ -316,6 +318,18 @@ public :
////////////////////////////////////////////////////////////
void parse(const std::string& data);
////////////////////////////////////////////////////////////
/// \brief Read values passed in the answer header
///
/// This function is used by Http to extract values passed
/// in the response.
///
/// \param in String stream containing the header values
///
////////////////////////////////////////////////////////////
void parseFields(std::istream &in);
////////////////////////////////////////////////////////////
// Types
////////////////////////////////////////////////////////////
@@ -343,9 +357,9 @@ public :
/// This is equivalent to calling setHost(host, port).
/// The port has a default value of 0, which means that the
/// HTTP client will use the right port according to the
/// protocol used (80 for HTTP, 443 for HTTPS). You should
/// leave it like this unless you really need a port other
/// than the standard one, or use an unknown protocol.
/// protocol used (80 for HTTP). You should leave it like
/// this unless you really need a port other than the
/// standard one, or use an unknown protocol.
///
/// \param host Web server to connect to
/// \param port Port to use for connection
@@ -360,9 +374,9 @@ public :
/// doesn't actually connect to it until you send a request.
/// The port has a default value of 0, which means that the
/// HTTP client will use the right port according to the
/// protocol used (80 for HTTP, 443 for HTTPS). You should
/// leave it like this unless you really need a port other
/// than the standard one, or use an unknown protocol.
/// protocol used (80 for HTTP). You should leave it like
/// this unless you really need a port other than the
/// standard one, or use an unknown protocol.
///
/// \param host Web server to connect to
/// \param port Port to use for connection
@@ -379,7 +393,7 @@ public :
/// Warning: this function waits for the server's response and may
/// not return instantly; use a thread if you don't want to block your
/// application, or use a timeout to limit the time to wait. A value
/// of Time::Zero means that the client will use the system defaut timeout
/// of Time::Zero means that the client will use the system default timeout
/// (which is usually pretty long).
///
/// \param request Request to send
@@ -390,7 +404,7 @@ public :
////////////////////////////////////////////////////////////
Response sendRequest(const Request& request, Time timeout = Time::Zero);
private :
private:
////////////////////////////////////////////////////////////
// Member data
@@ -414,7 +428,8 @@ private :
/// sf::Http is a very simple HTTP client that allows you
/// to communicate with a web server. You can retrieve
/// web pages, send data to an interactive resource,
/// download a remote file, etc.
/// download a remote file, etc. The HTTPS protocol is
/// not supported.
///
/// The HTTP client is split into 3 classes:
/// \li sf::Http::Request
Oops, something went wrong.

0 comments on commit 2033d66

Please sign in to comment.