aboutsummaryrefslogtreecommitdiff
path: root/games/minimal/mods/default/textures
diff options
context:
space:
mode:
authorAnton Tsyganenko <anton-tsyganenko@yandex.ru>2013-04-21 10:01:21 +0200
committerWeblate <42@minetest.ru>2013-04-22 22:37:08 +0200
commit4117ab473bcc393f6081277df96dd27c898c90ad (patch)
treec19dba8938be719b69bce56da436795db30f70d8 /games/minimal/mods/default/textures
parent93d36e88f9587acaa62db078137fc47b5926f676 (diff)
downloadminetest-4117ab473bcc393f6081277df96dd27c898c90ad.tar.gz
minetest-4117ab473bcc393f6081277df96dd27c898c90ad.tar.bz2
minetest-4117ab473bcc393f6081277df96dd27c898c90ad.zip
Translated using Weblate (Russian)
Diffstat (limited to 'games/minimal/mods/default/textures')
0 files changed, 0 insertions, 0 deletions
33' href='#n133'>133 134 135 136 137 138 139
/*
Minetest
Copyright (C) 2015 ShadowNinja <shadowninja@minetest.net>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef THREADING_ATOMIC_H
#define THREADING_ATOMIC_H


#if __cplusplus >= 201103L
	#include <atomic>
	template<typename T> using Atomic = std::atomic<T>;
	template<typename T> using GenericAtomic = std::atomic<T>;
#else

#define GCC_VERSION   (__GNUC__        * 100 + __GNUC_MINOR__)
#define CLANG_VERSION (__clang_major__ * 100 + __clang_minor__)
#if GCC_VERSION >= 407 || CLANG_VERSION >= 302
	#define ATOMIC_LOAD_GENERIC(T, v) do {               \
		T _val;                                          \
		 __atomic_load(&(v), &(_val), __ATOMIC_SEQ_CST); \
		return _val;                                     \
	} while(0)
	#define ATOMIC_LOAD(T, v)        return __atomic_load_n    (&(v),       __ATOMIC_SEQ_CST)
	#define ATOMIC_STORE(T, v, x)           __atomic_store     (&(v), &(x), __ATOMIC_SEQ_CST); return x
	#define ATOMIC_EXCHANGE(T, v, x) return __atomic_exchange  (&(v), &(x), __ATOMIC_SEQ_CST)
	#define ATOMIC_ADD_EQ(T, v, x)   return __atomic_add_fetch (&(v), (x),  __ATOMIC_SEQ_CST)