Skip to content

Commit 4f36c5e

Browse files
committed
Merge branch 'development' of https://git01.codeplex.com/casablanca into hide_sockets
2 parents fe5b689 + 6919c88 commit 4f36c5e

File tree

23 files changed

+149
-144
lines changed

23 files changed

+149
-144
lines changed

Release/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ elseif(UNIX) # This includes OSX
7171
option(BUILD_SHARED_LIBS "Build shared Libraries." ON)
7272
option(BUILD_TESTS "Build tests." ON)
7373
option(BUILD_SAMPLES "Build samples." ON)
74+
option(CASA_INSTALL_HEADERS "Install header files." ON)
75+
if(CASA_INSTALL_HEADERS)
76+
file(GLOB CASA_HEADERS_CPPREST include/cpprest/*.hpp include/cpprest/*.h)
77+
install(FILES ${CASA_HEADERS_CPPREST} DESTINATION include/cpprest)
78+
file(GLOB CASA_HEADERS_PPLX include/pplx/*.hpp include/pplx/*.h)
79+
install(FILES ${CASA_HEADERS_PPLX} DESTINATION include/pplx)
80+
file(GLOB CASA_HEADERS_DETAILS include/cpprest/details/*.hpp include/cpprest/details/*.h)
81+
install(FILES ${CASA_HEADERS_DETAILS} DESTINATION include/cpprest/details)
82+
endif()
7483
elseif(WIN32)
7584
option(BUILD_SHARED_LIBS "Build shared Libraries." ON)
7685
option(BUILD_TESTS "Build tests." ON)
@@ -169,4 +178,3 @@ endif()
169178
if(BUILD_SAMPLES)
170179
add_subdirectory(samples)
171180
endif()
172-

Release/include/compat/pplxtasks.h

Lines changed: 0 additions & 31 deletions
This file was deleted.

Release/include/cpprest/astreambuf.h

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -60,66 +60,64 @@ namespace concurrency = Concurrency;
6060
#pragma warning(disable : 4718)
6161
#endif
6262

63-
#ifndef _MS_WINDOWS
64-
// TFS 579628 - 1206: figure out how to avoid having this specialization for Linux (beware of 64-bit Linux)
65-
namespace std {
63+
namespace Concurrency
64+
{
65+
/// Library for asychronous streams.
66+
namespace streams
67+
{
68+
/// <summary>
69+
/// Extending the standard char_traits type with one that adds values and types
70+
/// that are unique to "C++ REST SDK" streams.
71+
/// </summary>
72+
/// <typeparam name="_CharType">
73+
/// The data type of the basic element of the stream.
74+
/// </typeparam>
75+
template<typename _CharType>
76+
struct char_traits : std::char_traits<_CharType>
77+
{
78+
/// <summary>
79+
/// Some synchronous functions will return this value if the operation
80+
/// requires an asynchronous call in a given situation.
81+
/// </summary>
82+
/// <returns>An <c>int_type</c> value which implies that an asynchronous call is required.</returns>
83+
static typename std::char_traits<_CharType>::int_type requires_async() { return std::char_traits<_CharType>::eof()-1; }
84+
};
85+
#if !defined(_MS_WINDOWS)
6686
template<>
67-
struct char_traits<unsigned char> : private char_traits<char>
87+
struct char_traits<unsigned char> : private std::char_traits<char>
6888
{
6989
public:
7090
typedef unsigned char char_type;
7191

72-
using char_traits<char>::eof;
73-
using char_traits<char>::int_type;
74-
using char_traits<char>::off_type;
75-
using char_traits<char>::pos_type;
92+
using std::char_traits<char>::eof;
93+
using std::char_traits<char>::int_type;
94+
using std::char_traits<char>::off_type;
95+
using std::char_traits<char>::pos_type;
7696

7797
static size_t length(const unsigned char* str)
7898
{
79-
return char_traits<char>::length(reinterpret_cast<const char*>(str));
99+
return std::char_traits<char>::length(reinterpret_cast<const char*>(str));
80100
}
81101

82102
static void assign(unsigned char& left, const unsigned char& right) { left = right; }
83103
static unsigned char* assign(unsigned char* left, size_t n, unsigned char value)
84104
{
85-
return reinterpret_cast<unsigned char*>(char_traits<char>::assign(reinterpret_cast<char*>(left), n, static_cast<char>(value)));
105+
return reinterpret_cast<unsigned char*>(std::char_traits<char>::assign(reinterpret_cast<char*>(left), n, static_cast<char>(value)));
86106
}
87107

88108
static unsigned char* copy(unsigned char* left, const unsigned char* right, size_t n)
89109
{
90-
return reinterpret_cast<unsigned char*>(char_traits<char>::copy(reinterpret_cast<char*>(left), reinterpret_cast<const char*>(right), n));
110+
return reinterpret_cast<unsigned char*>(std::char_traits<char>::copy(reinterpret_cast<char*>(left), reinterpret_cast<const char*>(right), n));
91111
}
92112

93113
static unsigned char* move(unsigned char* left, const unsigned char* right, size_t n)
94114
{
95-
return reinterpret_cast<unsigned char*>(char_traits<char>::move(reinterpret_cast<char*>(left), reinterpret_cast<const char*>(right), n));
115+
return reinterpret_cast<unsigned char*>(std::char_traits<char>::move(reinterpret_cast<char*>(left), reinterpret_cast<const char*>(right), n));
96116
}
97-
};
98-
}
99-
#endif // _MS_WINDOWS
100117

101-
namespace Concurrency
102-
{
103-
/// Library for asychronous streams.
104-
namespace streams
105-
{
106-
/// <summary>
107-
/// Extending the standard char_traits type with one that adds values and types
108-
/// that are unique to "C++ REST SDK" streams.
109-
/// </summary>
110-
/// <typeparam name="_CharType">
111-
/// The data type of the basic element of the stream.
112-
/// </typeparam>
113-
template<typename _CharType>
114-
struct char_traits : std::char_traits<_CharType>
115-
{
116-
/// <summary>
117-
/// Some synchronous functions will return this value if the operation
118-
/// requires an asynchronous call in a given situation.
119-
/// </summary>
120-
/// <returns>An <c>int_type</c> value which implies that an asynchronous call is required.</returns>
121-
static typename std::char_traits<_CharType>::int_type requires_async() { return std::char_traits<_CharType>::eof()-1; }
118+
static int_type requires_async() { return eof()-1; }
122119
};
120+
#endif
123121

124122
namespace details {
125123

Release/include/cpprest/basic_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#include <cstdint>
4141
#endif
4242

43-
#include "compat/SafeInt3.hpp"
43+
#include "cpprest/details/SafeInt3.hpp"
4444
typedef SafeInt<size_t> SafeSize;
4545

4646
namespace utility
@@ -124,4 +124,4 @@ typedef std::basic_ostringstream<utf16char> utf16ostringstream;
124124
typedef std::basic_ostream<utf16char> utf16ostream;
125125
typedef std::basic_istream<utf16char> utf16istream;
126126
typedef std::basic_istringstream<utf16char> utf16istringstream;
127-
#endif
127+
#endif

Release/include/compat/linux_compat.h renamed to Release/include/cpprest/details/linux_compat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <iostream>
2727
#define __cdecl __attribute__ ((cdecl))
2828

29-
#include "compat/nosal.h"
29+
#include "cpprest/details/nosal.h"
3030

3131
// MSVC doesn't support this yet
3232
#define _noexcept noexcept

Release/include/compat/windows_compat.h renamed to Release/include/cpprest/details/windows_compat.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
// Support VS2012 SAL syntax only
3131
#include <sal.h>
3232
#else
33-
#include "compat/nosal.h"
33+
#include "cpprest/details/nosal.h"
3434
#endif
3535

3636
#define _noexcept
@@ -41,4 +41,4 @@
4141
#define CASABLANCA_DEPRECATED(x)
4242
#else
4343
#define CASABLANCA_DEPRECATED(x) __declspec(deprecated(x))
44-
#endif
44+
#endif

Release/include/cpprest/filestream.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ namespace details {
638638
{
639639
return (pos_type)_seekwrpos_fsb(m_info, size_t(pos), sizeof(_CharType));
640640
}
641-
return (pos_type)std::char_traits<_CharType>::eof();
641+
return (pos_type)Concurrency::streams::char_traits<_CharType>::eof();
642642
}
643643

644644
/// <summary>

0 commit comments

Comments
 (0)