Skip to content

Commit

Permalink
fixed headers & osx TLS fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kmvisscher committed Dec 16, 2015
1 parent 9260824 commit c06a51f
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 24 deletions.
4 changes: 2 additions & 2 deletions bsp/include/bsp/barrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
* THE SOFTWARE.
*/
#pragma once
#ifndef __BARRIER_H__
#define __BARRIER_H__
#ifndef __BSPLIB_BARRIER_H__
#define __BSPLIB_BARRIER_H__

#include "bsp/bspAbort.h"

Expand Down
4 changes: 2 additions & 2 deletions bsp/include/bsp/bsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
* THE SOFTWARE.
*/
#pragma once
#ifndef __BSP_H__
#define __BSP_H__
#ifndef __BSPLIB_BSP_H__
#define __BSPLIB_BSP_H__

#ifndef DEBUG
# define BSP_SKIP_CHECKS
Expand Down
4 changes: 2 additions & 2 deletions bsp/include/bsp/bspAbort.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
* THE SOFTWARE.
*/
#pragma once
#ifndef __BSPABORT_H__
#define __BSPABORT_H__
#ifndef __BSPLIB_BSPABORT_H__
#define __BSPLIB_BSPABORT_H__

#include <exception>
#include <string>
Expand Down
9 changes: 5 additions & 4 deletions bsp/include/bsp/bspClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
* THE SOFTWARE.
*/
#pragma once
#ifndef __BSPCLASS_H__
#define __BSPCLASS_H__
#ifndef __BSPLIB_BSPCLASS_H__
#define __BSPLIB_BSPCLASS_H__

#include "bsp/communicationQueues.h"
#include "bsp/condVarBarrier.h"
Expand Down Expand Up @@ -165,8 +165,9 @@ class BSP

BSP_FORCEINLINE uint32_t &ProcId()
{
static thread_local uint32_t gPID = 0xdeadbeef;

//static thread_local uint32_t gPID = 0xdeadbeef;
BSP_TLS static uint32_t gPID = 0xdeadbeef;

return gPID;
}

Expand Down
4 changes: 2 additions & 2 deletions bsp/include/bsp/bspExt.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
* THE SOFTWARE.
*/
#pragma once
#ifndef __BSPEXT_H__
#define __BSPEXT_H__
#ifndef __BSPLIB_BSPEXT_H__
#define __BSPLIB_BSPEXT_H__

#include "bsp/bspClass.h"
#include "bsp/util.h"
Expand Down
4 changes: 2 additions & 2 deletions bsp/include/bsp/communicationQueues.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
* THE SOFTWARE.
*/
#pragma once
#ifndef __COMMUNICATIONQUEUES_H__
#define __COMMUNICATIONQUEUES_H__
#ifndef __BSPLIB_COMMUNICATIONQUEUES_H__
#define __BSPLIB_COMMUNICATIONQUEUES_H__

#include <vector>

Expand Down
4 changes: 2 additions & 2 deletions bsp/include/bsp/condVarBarrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
* THE SOFTWARE.
*/
#pragma once
#ifndef __CONDVARBARRIER_H__
#define __CONDVARBARRIER_H__
#ifndef __BSPLIB_CONDVARBARRIER_H__
#define __BSPLIB_CONDVARBARRIER_H__

#include "bsp/bspAbort.h"

Expand Down
4 changes: 2 additions & 2 deletions bsp/include/bsp/mixedBarrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
* THE SOFTWARE.
*/
#pragma once
#ifndef __MIXEDBARRIER_H__
#define __MIXEDBARRIER_H__
#ifndef __BSPLIB_MIXEDBARRIER_H__
#define __BSPLIB_MIXEDBARRIER_H__

#define BSP_SPIN_ITERATIONS 10000

Expand Down
4 changes: 2 additions & 2 deletions bsp/include/bsp/requests.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
* THE SOFTWARE.
*/
#pragma once
#ifndef __REQUESTS_H__
#define __REQUESTS_H__
#ifndef __BSPLIB_REQUESTS_H__
#define __BSPLIB_REQUESTS_H__

#include "bsp/stackAllocator.h"

Expand Down
4 changes: 2 additions & 2 deletions bsp/include/bsp/spinLock.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
* THE SOFTWARE.
*/
#pragma once
#ifndef __SPINLOCK_H__
#define __SPINLOCK_H__
#ifndef __BSPLIB_SPINLOCK_H__
#define __BSPLIB_SPINLOCK_H__

#include <atomic>

Expand Down
16 changes: 14 additions & 2 deletions bsp/include/bsp/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
* THE SOFTWARE.
*/
#pragma once
#ifndef __UTIL_H__
#define __UTIL_H__
#ifndef __BSPLIB_UTIL_H__
#define __BSPLIB_UTIL_H__

// From boost. Forces inlining on multiple compilers for extra perfomance.
#if !defined(BSP_FORCEINLINE)
Expand All @@ -35,4 +35,16 @@
# endif
#endif


#if !defined(BSP_TLS)
# if defined(_MSC_VER)
# define BSP_TLS __declspec(thread)
# elif defined(__GNUC__) && __GNUC__ > 3
// Clang also defines __GNUC__ (as 4)
# define BSP_TLS __thread
# else
# error "Define a thread local storage qualifier for your compiler/platform!"
# endif
#endif

#endif

0 comments on commit c06a51f

Please sign in to comment.