GCC compatibility changes

This commit is contained in:
John Wellbelove 2018-01-23 13:14:08 +00:00
parent 71b865ae6b
commit 3385d2cf04
4 changed files with 17 additions and 10 deletions

View File

@ -1,5 +1,5 @@
name=Embedded Template Library
version=10.11.1
version=10.11.2
author= John Wellbelove <john.wellbelove@etlcpp.com>
maintainer=John Wellbelove <john.wellbelove@etlcpp.com>
sentence=A C++ template library tailored for embedded systems.

View File

@ -38,8 +38,14 @@ SOFTWARE.
#define ETL_DEBUG
#endif
#include "etl_profile.h"
#undef ETL_CPP11_SUPPORTED
#undef ETL_CPP14_SUPPORTED
#undef ETL_NO_NULLPTR_SUPPORT
#undef ETL_NO_LARGE_CHAR_SUPPORT
#undef ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
#undef ETL_ATOMIC_SUPPORTED
#include "etl_profile.h"
#if ETL_CPP11_SUPPORTED
#define ETL_CONSTEXPR constexpr

View File

@ -1,4 +1,7 @@
===============================================================================
10.11.2
GCC compatibility changes.
===============================================================================
10.11.1
GCC compatibility changes.
===============================================================================

View File

@ -29,22 +29,20 @@ SOFTWARE.
#ifndef __ECL_USER__
#define __ECL_USER__
#include "platform.h"
#include <stdint.h>
#if defined(ETL_COMPILER_GCC)
#define ECL_TIMER_TIMER_SEMAPHORE uint32_t
#define ECL_TIMER_DISABLE_PROCESSING(x) __sync_fetch_and_add(&x, 1)
#define ECL_TIMER_ENABLE_PROCESSING(x) __sync_fetch_and_sub(&x, 1)
#define ECL_TIMER_PROCESSING_ENABLED(x) (__sync_fetch_and_add(&x, 0) == 0)
#else
#if defined(_MSC_VER)
#include <Windows.h>
#define ECL_TIMER_TIMER_SEMAPHORE uint32_t
#define ECL_TIMER_DISABLE_PROCESSING(x) InterlockedIncrement((volatile long*)&x)
#define ECL_TIMER_ENABLE_PROCESSING(x) InterlockedDecrement((volatile long*)&x)
#define ECL_TIMER_PROCESSING_ENABLED(x) (InterlockedAdd((volatile long*)&x, 0) == 0)
#else
#define ECL_TIMER_TIMER_SEMAPHORE uint32_t
#define ECL_TIMER_DISABLE_PROCESSING(x) __sync_fetch_and_add(&x, 1)
#define ECL_TIMER_ENABLE_PROCESSING(x) __sync_fetch_and_sub(&x, 1)
#define ECL_TIMER_PROCESSING_ENABLED(x) (__sync_fetch_and_add(&x, 0) == 0)
#endif
#endif