Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,12 @@ elseif(CC_TARGET_OS_OSX)
if(NOT CC_XCODE_PROJECT)
set(OSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET} CC")
if (${OSX_DEPLOYMENT_TARGET} STREQUAL " CC")
set(OSX_DEPLOYMENT_TARGET "10.7")
add_compile_options(-mmacosx-version-min=10.7)
set(OSX_DEPLOYMENT_TARGET "10.9")
add_compile_options(-mmacosx-version-min=10.9)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
-mmacosx-version-min=10.7")
-mmacosx-version-min=10.9 -std=gnu99")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
-mmacosx-version-min=10.7")
-mmacosx-version-min=10.9 -std=gnu++11")
else()
set(OSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}")
message(WARNING "!! macOS Deployment Target was set to $ENV{MACOSX_DEPLOYMENT_TARGET}. Using it as is.")
Expand Down
1 change: 1 addition & 0 deletions bin/ChakraCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ target_include_directories (
${CHAKRACORE_SOURCE_DIR}/lib/Parser
${CHAKRACORE_SOURCE_DIR}/lib/Jsrt
${wasm_includes}
"-fvisibility=hidden"
)

if (NOT STATIC_LIBRARY)
Expand Down
9 changes: 4 additions & 5 deletions lib/Common/Codex/Utf8Codex.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
typedef WCHAR char16;
#define _u(s) L##s
#else
typedef char16_t char16;
#define _u(s) u##s
#endif

Expand Down Expand Up @@ -164,7 +163,7 @@ namespace utf8
// special cases ASCII to avoid a call the most common characters.
LPUTF8 EncodeFull(char16 ch, __out_ecount(3) LPUTF8 ptr);

// Encode a surrogate pair into a utf8 sequence
// Encode a surrogate pair into a utf8 sequence
LPUTF8 EncodeSurrogatePair(char16 surrogateHigh, char16 surrogateLow, __out_ecount(4) LPUTF8 ptr);

// Encode ch into a UTF8 sequence ignoring surrogate pairs (which are encoded as two
Expand All @@ -190,7 +189,7 @@ namespace utf8
else if (ch < 0xD800 || (ch >= 0xE000 && ch <= 0xFFFF))
{
return EncodeFull(ch, ptr);
}
}

// We're now decoding a surrogate pair. If the input is malformed (eg. low surrogate is absent)
// we'll instead encode the unicode replacement character as utf8
Expand All @@ -199,13 +198,13 @@ namespace utf8
char16 surrogateHigh = ch;
char16 surrogateLow = **source;

// Validate that the surrogate code units are within the appropriate
// Validate that the surrogate code units are within the appropriate
// ranges for high and low surrogates
if ((surrogateHigh >= 0xD800 && surrogateHigh <= 0xDBFF) &&
(surrogateLow >= 0xDC00 && surrogateLow <= 0xDFFF))
{
LPUTF8 retptr = EncodeSurrogatePair(surrogateHigh, surrogateLow, ptr);

// SAL analysis gets confused if we call EncodeSurrogatePair after
// modifying cch

Expand Down
13 changes: 6 additions & 7 deletions lib/Common/CommonDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -482,14 +482,10 @@
#define PROFILE_BAILOUT_RECORD_MEMORY
#define MEMSPECT_TRACKING

// xplat-todo: Depends on C++ type-info
// enable later on non-VC++ compilers
#ifndef __APPLE__
#define PROFILE_RECYCLER_ALLOC
// Needs to compile in debug mode
// Just needs strings converted
#define PROFILE_DICTIONARY 1
#endif

#define PROFILE_STRINGS

Expand Down Expand Up @@ -523,12 +519,9 @@
#endif
#endif

// xplat: on apple looks typeid(char16_t) does not work, hit error: Undefined symbols for architecture x86_64: "typeinfo for char16_t"
#ifndef __APPLE__
#define HEAP_TRACK_ALLOC
#define CHECK_MEMORY_LEAK
#define LEAK_REPORT
#endif

#define PROJECTION_METADATA_TRACE
#define ERROR_TRACE
Expand Down Expand Up @@ -770,3 +763,9 @@
#endif
#endif // __APPLE__
#endif // THREAD_LOCAL

#ifndef _WIN32
#define NO_EXPORT __attribute__((visibility("hidden")))
#else
#define NO_EXPORT
#endif
1 change: 0 additions & 1 deletion lib/Common/CommonPal.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ __forceinline void __int2c()
#include "inc/rt/no_sal2.h"
#include "inc/rt/oaidl.h"

typedef char16_t char16;
#define _u(s) u##s

typedef GUID UUID;
Expand Down
4 changes: 1 addition & 3 deletions lib/Common/Core/CommonTypedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
typedef WCHAR char16;
#define _u(s) L##s
#else
typedef char16_t char16;
#define _u(s) u##s
#endif

typedef char16 wchar;
typedef unsigned int uint;
typedef unsigned short ushort;

// Use of ulong is not allowed in ChakraCore- uint32 should be used instead since
// Use of ulong is not allowed in ChakraCore- uint32 should be used instead since
// it's our cross-platform 32 bit integer value. However, legacy code in ChakraFull
// still depends on ulong so it's allowed for full builds.
#ifdef NTBUILD
Expand Down Expand Up @@ -62,4 +61,3 @@ namespace Js
{
typedef uint32 LocalFunctionId;
};

18 changes: 9 additions & 9 deletions lib/Common/Memory/Allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ void AssertValue(void * mem, T value, uint byteCount)
#ifndef __PLACEMENT_NEW_INLINE
#define __PLACEMENT_NEW_INLINE

_Ret_notnull_
NO_EXPORT _Ret_notnull_
inline void * __cdecl
operator new(
DECLSPEC_GUARD_OVERFLOW size_t byteSize,
Expand All @@ -379,7 +379,7 @@ _In_ void * previousAllocation) throw()
}


inline void __cdecl
NO_EXPORT inline void __cdecl
operator delete(
void * allocationToFree, // Allocation to free
void * previousAllocation // Previously allocated memory
Expand All @@ -394,7 +394,7 @@ void * previousAllocation // Previously allocated memory
// throwing operator new overrides
//----------------------------------------
template <typename TAllocator>
_Ret_notnull_ void * __cdecl
NO_EXPORT _Ret_notnull_ void * __cdecl
operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char * (TAllocator::*AllocFunc)(size_t))
{
AssertCanHandleOutOfMemory();
Expand All @@ -405,7 +405,7 @@ operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char *
}

template <typename TAllocator>
_Ret_notnull_ inline void * __cdecl
NO_EXPORT _Ret_notnull_ inline void * __cdecl
operator new[](DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char * (TAllocator::*AllocFunc)(size_t))
{
AssertCanHandleOutOfMemory();
Expand All @@ -416,7 +416,7 @@ operator new[](DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char
}

template <typename TAllocator>
_Ret_notnull_ inline void * __cdecl
NO_EXPORT _Ret_notnull_ inline void * __cdecl
operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char * (TAllocator::*AllocFunc)(size_t), DECLSPEC_GUARD_OVERFLOW size_t plusSize)
{
AssertCanHandleOutOfMemory();
Expand All @@ -433,7 +433,7 @@ operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char *
// nothrow operator new overrides
//----------------------------------------
template <typename TAllocator>
_Ret_maybenull_ inline void * __cdecl
NO_EXPORT _Ret_maybenull_ inline void * __cdecl
operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool nothrow, char * (TAllocator::*AllocFunc)(size_t))
{
Assert(nothrow);
Expand All @@ -444,7 +444,7 @@ operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool n


template <typename TAllocator>
_Ret_maybenull_ inline void * __cdecl
NO_EXPORT _Ret_maybenull_ inline void * __cdecl
operator new[](DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool nothrow, char * (TAllocator::*AllocFunc)(size_t))
{
Assert(nothrow);
Expand All @@ -455,7 +455,7 @@ operator new[](DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool


template <typename TAllocator>
_Ret_maybenull_ inline void * __cdecl
NO_EXPORT _Ret_maybenull_ inline void * __cdecl
operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool nothrow, char * (TAllocator::*AllocFunc)(size_t), DECLSPEC_GUARD_OVERFLOW size_t plusSize)
{
Assert(nothrow);
Expand All @@ -469,7 +469,7 @@ operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool n


template <typename TAllocator>
_Ret_maybenull_ inline void * __cdecl
NO_EXPORT _Ret_maybenull_ inline void * __cdecl
operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool nothrow, char * (TAllocator::*AllocFunc)(size_t), DECLSPEC_GUARD_OVERFLOW size_t plusSize, bool prefix)
{
Assert(nothrow);
Expand Down
2 changes: 2 additions & 0 deletions lib/Runtime/PlatformAgnostic/RuntimePlatformAgnosticPch.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#ifdef _WIN32
#include "CommonDefines.h"
#include "CommonMin.h"
#else
#include "pal.h"
#endif

#ifdef _MSC_VER
Expand Down
2 changes: 1 addition & 1 deletion pal/inc/pal_mstypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,8 @@ typedef LONG_PTR LPARAM;
typedef unsigned short char16_t;
#endif // __cplusplus

typedef char16_t char16;
typedef char16_t WCHAR;
#define WCHAR_IS_CHAR16_T 1

#ifdef PAL_STDCPP_COMPAT

Expand Down