Skip to content

Commit

Permalink
Externals: Update SFML to 2.5.0
Browse files Browse the repository at this point in the history
Among other things, this finally allows pushing 64-bit values into
packets without needing to manually subdivide the value into two 32-bit
values.
  • Loading branch information
lioncash committed Aug 27, 2018
1 parent 4c75331 commit 3130d38
Show file tree
Hide file tree
Showing 39 changed files with 1,144 additions and 283 deletions.
1 change: 1 addition & 0 deletions Externals/SFML/build/vc2010/SFML_Network.vcxproj
Expand Up @@ -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" />
Expand Down
1 change: 1 addition & 0 deletions Externals/SFML/build/vc2010/SFML_Network.vcxproj.filters
Expand Up @@ -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" />
Expand Down
103 changes: 90 additions & 13 deletions Externals/SFML/include/SFML/Config.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.
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
////////////////////////////////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion Externals/SFML/include/SFML/Network.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.
Expand Down Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion Externals/SFML/include/SFML/Network/Export.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.
Expand Down
59 changes: 37 additions & 22 deletions Externals/SFML/include/SFML/Network/Http.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.
Expand Down Expand Up @@ -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
};

////////////////////////////////////////////////////////////
Expand All @@ -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).
Expand Down Expand Up @@ -141,7 +143,7 @@ public :
////////////////////////////////////////////////////////////
void setBody(const std::string& body);

private :
private:

friend class Http;

Expand Down Expand Up @@ -190,7 +192,7 @@ public :
////////////////////////////////////////////////////////////
class SFML_NETWORK_API Response
{
public :
public:

////////////////////////////////////////////////////////////
/// \brief Enumerate all the valid status codes for a response
Expand All @@ -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)

Expand Down Expand Up @@ -301,7 +303,7 @@ public :
////////////////////////////////////////////////////////////
const std::string& getBody() const;

private :
private:

friend class Http;

Expand All @@ -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
////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -390,7 +404,7 @@ public :
////////////////////////////////////////////////////////////
Response sendRequest(const Request& request, Time timeout = Time::Zero);

private :
private:

////////////////////////////////////////////////////////////
// Member data
Expand All @@ -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
Expand Down

0 comments on commit 3130d38

Please sign in to comment.