Skip to content

Commit 4398657

Browse files
committed
fix master build break - VSO
1 parent 8d3d7c8 commit 4398657

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed

lib/Common/CommonDefines.h

-6
Original file line numberDiff line numberDiff line change
@@ -765,9 +765,3 @@
765765
#endif
766766
#endif // __APPLE__
767767
#endif // THREAD_LOCAL
768-
769-
#ifndef _WIN32
770-
#define NO_EXPORT __attribute__((visibility("hidden")))
771-
#else
772-
#define NO_EXPORT
773-
#endif

lib/Common/Memory/Allocator.h

+25-14
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ class Allocator
351351
void (*recoverMemoryFunc)();
352352
};
353353

354-
355354
template <typename T>
356355
void AssertValue(void * mem, T value, uint byteCount)
357356
{
@@ -365,12 +364,20 @@ void AssertValue(void * mem, T value, uint byteCount)
365364
}
366365
}
367366

367+
#ifndef _WIN32
368+
#define NO_EXPORT(x) \
369+
__attribute__((visibility("hidden"))) \
370+
x
371+
#else
372+
#define NO_EXPORT(x) x
373+
#endif
374+
368375
// For the debugger extension, we don't need the placement news
369376
#ifndef __PLACEMENT_NEW_INLINE
370377
#define __PLACEMENT_NEW_INLINE
371378

372-
NO_EXPORT _Ret_notnull_
373-
inline void * __cdecl
379+
_Ret_notnull_
380+
NO_EXPORT(inline void *) __cdecl
374381
operator new(
375382
DECLSPEC_GUARD_OVERFLOW size_t byteSize,
376383
_In_ void * previousAllocation) throw()
@@ -379,7 +386,7 @@ _In_ void * previousAllocation) throw()
379386
}
380387

381388

382-
NO_EXPORT inline void __cdecl
389+
NO_EXPORT(inline void) __cdecl
383390
operator delete(
384391
void * allocationToFree, // Allocation to free
385392
void * previousAllocation // Previously allocated memory
@@ -394,7 +401,8 @@ void * previousAllocation // Previously allocated memory
394401
// throwing operator new overrides
395402
//----------------------------------------
396403
template <typename TAllocator>
397-
NO_EXPORT _Ret_notnull_ void * __cdecl
404+
_Ret_notnull_
405+
NO_EXPORT(void *) __cdecl
398406
operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char * (TAllocator::*AllocFunc)(size_t))
399407
{
400408
AssertCanHandleOutOfMemory();
@@ -405,7 +413,8 @@ operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char *
405413
}
406414

407415
template <typename TAllocator>
408-
NO_EXPORT _Ret_notnull_ inline void * __cdecl
416+
_Ret_notnull_
417+
NO_EXPORT(inline void *) __cdecl
409418
operator new[](DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char * (TAllocator::*AllocFunc)(size_t))
410419
{
411420
AssertCanHandleOutOfMemory();
@@ -416,7 +425,8 @@ operator new[](DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char
416425
}
417426

418427
template <typename TAllocator>
419-
NO_EXPORT _Ret_notnull_ inline void * __cdecl
428+
_Ret_notnull_
429+
NO_EXPORT(inline void *) __cdecl
420430
operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char * (TAllocator::*AllocFunc)(size_t), DECLSPEC_GUARD_OVERFLOW size_t plusSize)
421431
{
422432
AssertCanHandleOutOfMemory();
@@ -433,7 +443,8 @@ operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, char *
433443
// nothrow operator new overrides
434444
//----------------------------------------
435445
template <typename TAllocator>
436-
NO_EXPORT _Ret_maybenull_ inline void * __cdecl
446+
_Ret_maybenull_
447+
NO_EXPORT(inline void *) __cdecl
437448
operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool nothrow, char * (TAllocator::*AllocFunc)(size_t))
438449
{
439450
Assert(nothrow);
@@ -442,9 +453,9 @@ operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool n
442453
return buffer;
443454
}
444455

445-
446456
template <typename TAllocator>
447-
NO_EXPORT _Ret_maybenull_ inline void * __cdecl
457+
_Ret_maybenull_
458+
NO_EXPORT(inline void *) __cdecl
448459
operator new[](DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool nothrow, char * (TAllocator::*AllocFunc)(size_t))
449460
{
450461
Assert(nothrow);
@@ -453,9 +464,9 @@ operator new[](DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool
453464
return buffer;
454465
}
455466

456-
457467
template <typename TAllocator>
458-
NO_EXPORT _Ret_maybenull_ inline void * __cdecl
468+
_Ret_maybenull_
469+
NO_EXPORT(inline void *) __cdecl
459470
operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool nothrow, char * (TAllocator::*AllocFunc)(size_t), DECLSPEC_GUARD_OVERFLOW size_t plusSize)
460471
{
461472
Assert(nothrow);
@@ -467,9 +478,9 @@ operator new(DECLSPEC_GUARD_OVERFLOW size_t byteSize, TAllocator * alloc, bool n
467478
return buffer;
468479
}
469480

470-
471481
template <typename TAllocator>
472-
NO_EXPORT _Ret_maybenull_ inline void * __cdecl
482+
_Ret_maybenull_
483+
NO_EXPORT(inline void *) __cdecl
473484
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)
474485
{
475486
Assert(nothrow);

0 commit comments

Comments
 (0)