Skip to content

Commit

Permalink
Added clang mutex header redirect to GCC implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
jwellbelove committed Dec 5, 2020
1 parent 6cf6c92 commit fbfd8ac
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 10 deletions.
3 changes: 3 additions & 0 deletions include/etl/mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ SOFTWARE.
#elif defined(ETL_COMPILER_GCC)
#include "mutex/mutex_gcc_sync.h"
#define ETL_HAS_MUTEX 1
#elif defined(ETL_COMPILER_GCC)
#include "mutex/mutex_clang_sync.h"
#define ETL_HAS_MUTEX 1
#else
#define ETL_HAS_MUTEX 0
#endif
Expand Down
34 changes: 34 additions & 0 deletions include/etl/mutex/mutex_clang_sync.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2020 jwellbelove
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files(the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions :
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/

#ifndef ETL_MUTEX_CLANG_INCLUDED
#define ETL_MUTEX_CLANG_INCLUDED

#include "mutex_gcc_sync.h"

#endif
2 changes: 1 addition & 1 deletion include/etl/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ SOFTWARE.

#define ETL_VERSION_MAJOR 19
#define ETL_VERSION_MINOR 3
#define ETL_VERSION_PATCH 1
#define ETL_VERSION_PATCH 2
#define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) "." ETL_STRINGIFY(ETL_VERSION_MINOR) "." ETL_STRINGIFY(ETL_VERSION_PATCH)
#define ETL_VERSION_W ETL_STRINGIFY(ETL_VERSION_MAJOR) L"." ETL_STRINGIFY(ETL_VERSION_MINOR) L"." ETL_STRINGIFY(ETL_VERSION_PATCH)
#define ETL_VERSION_U16 ETL_STRINGIFY(ETL_VERSION_MAJOR) u"." ETL_STRINGIFY(ETL_VERSION_MINOR) u"." ETL_STRINGIFY(ETL_VERSION_PATCH)
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Embedded Template Library",
"version": "19.3.1",
"version": "19.3.2",
"author s": {
"name": "John Wellbelove",
"email": "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Embedded Template Library
version=19.3.1
version=19.3.2
author= John Wellbelove <[email protected]>
maintainer=John Wellbelove <[email protected]>
license=MIT
Expand Down
4 changes: 4 additions & 0 deletions support/Release notes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
===============================================================================
19.3.2
Added No-STL clang mutex that uses GCC implementation.

===============================================================================
19.3.1
Fixed etl::format_spec constexpr compatibility with C++11.
Expand Down
7 changes: 0 additions & 7 deletions test/test_queue_mpmc_mutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,6 @@ namespace

using ItemM = TestDataM<int>;

// std::ostream& operator <<(std::ostream& os, const Data& data)
// {
// os << data.a << " " << data.b << " " << data.c << " " << data.d;
//
// return os;
// }

SUITE(test_queue_mpmc_mutex)
{
//*************************************************************************
Expand Down
1 change: 1 addition & 0 deletions test/vs2019/etl.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1291,6 +1291,7 @@
<ClInclude Include="..\..\include\etl\macros.h" />
<ClInclude Include="..\..\include\etl\message_packet.h" />
<ClInclude Include="..\..\include\etl\multi_array.h" />
<ClInclude Include="..\..\include\etl\mutex\mutex_clang_sync.h" />
<ClInclude Include="..\..\include\etl\mutex\mutex_freertos.h" />
<ClInclude Include="..\..\include\etl\negative.h" />
<ClInclude Include="..\..\include\etl\null_type.h" />
Expand Down
3 changes: 3 additions & 0 deletions test/vs2019/etl.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,9 @@
<ClInclude Include="..\..\include\etl\buffer_descriptors.h">
<Filter>ETL\Containers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\etl\mutex\mutex_clang_sync.h">
<Filter>ETL\Utilities\Mutex</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\main.cpp">
Expand Down

0 comments on commit fbfd8ac

Please sign in to comment.