Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(666)

Unified Diff: mojo/public/c/include/mojo/macros.h

Issue 2250183003: Make the fuchsia mojo/public repo the source of truth. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/c/include/mojo/environment/logger.h ('k') | mojo/public/c/include/mojo/result.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/include/mojo/macros.h
diff --git a/mojo/public/c/include/mojo/macros.h b/mojo/public/c/include/mojo/macros.h
deleted file mode 100644
index 886ed047fb48ade7f2ea942525c7b507bd61514d..0000000000000000000000000000000000000000
--- a/mojo/public/c/include/mojo/macros.h
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef MOJO_PUBLIC_C_INCLUDE_MOJO_MACROS_H_
-#define MOJO_PUBLIC_C_INCLUDE_MOJO_MACROS_H_
-
-#include <stddef.h>
-
-// Annotate a variable indicating it's okay if it's unused.
-// Use like:
-// int x = ...;
-// MOJO_ALLOW_UNUSED_LOCAL(x);
-#define MOJO_ALLOW_UNUSED_LOCAL(x) false ? (void)x : (void)0
-
-// Annotate a function indicating that the caller must examine the return value.
-// Use like:
-// int foo() MOJO_WARN_UNUSED_RESULT;
-// Note that it can only be used on the prototype, and not the definition.
-#if defined(__GNUC__)
-#define MOJO_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
-#else
-#define MOJO_WARN_UNUSED_RESULT
-#endif
-
-// Assert things at compile time. (|msg| should be a valid identifier name.)
-// Use like:
-// MOJO_STATIC_ASSERT(sizeof(Foo) == 12, "Foo has invalid size");
-#if defined(__cplusplus)
-#define MOJO_STATIC_ASSERT(expr, msg) static_assert(expr, msg)
-#else
-#define MOJO_STATIC_ASSERT(expr, msg) _Static_assert(expr, msg)
-#endif
-
-// Like the C++11 |alignof| operator.
-#if defined(__cplusplus) && __cplusplus >= 201103L
-#define MOJO_ALIGNOF(type) alignof(type)
-#elif defined(__GNUC__)
-#define MOJO_ALIGNOF(type) __alignof__(type)
-#elif defined(_MSC_VER)
-// The use of |sizeof| is to work around a bug in MSVC 2010 (see
-// http://goo.gl/isH0C; supposedly fixed since then).
-#define MOJO_ALIGNOF(type) (sizeof(type) - sizeof(type) + __alignof(type))
-#else
-#error "Please define MOJO_ALIGNOF() for your compiler."
-#endif
-
-// Specify the alignment of a |struct|, etc.
-// Use like:
-// struct MOJO_ALIGNAS(8) Foo { ... };
-// Unlike the C++11 |alignas()|, |alignment| must be an integer. It may not be a
-// type, nor can it be an expression like |MOJO_ALIGNOF(type)| (due to the
-// non-C++11 MSVS version).
-#if defined(__cplusplus) && __cplusplus >= 201103L
-#define MOJO_ALIGNAS(alignment) alignas(alignment)
-#elif defined(__GNUC__)
-#define MOJO_ALIGNAS(alignment) __attribute__((aligned(alignment)))
-#elif defined(_MSC_VER)
-#define MOJO_ALIGNAS(alignment) __declspec(align(alignment))
-#else
-#error "Please define MOJO_ALIGNAS() for your compiler."
-#endif
-
-// Use these to declare functions in C header files so that they'll be usable
-// from C++.
-#if defined(__cplusplus)
-#define MOJO_BEGIN_EXTERN_C extern "C" {
-#define MOJO_END_EXTERN_C }
-#else
-#define MOJO_BEGIN_EXTERN_C
-#define MOJO_END_EXTERN_C
-#endif
-
-// Use |MOJO_RESTRICT| (in C function declarations) in place of C99's
-// |restrict|, to work properly with C++. (It allows certain optimizations, but
-// more importantly it serves a documentary purpose for the caller.)
-//
-// Recommendation: If a function has multiple pointer parameters at least one of
-// which is to non-const, then all the pointer parameters should be declared
-// using |MOJO_RESTRICT| unless aliasing is explicitly allowed.
-#if defined(__GNUC__) || defined(_MSC_VER)
-// Use |__restrict|, since it works both in C++ and when compiling as C90
-// (|restrict| is only available in C99 and later, and never in C++).
-#define MOJO_RESTRICT __restrict
-#else
-#error "Please define MOJO_RESTRICT for your compiler."
-#endif
-
-#endif // MOJO_PUBLIC_C_INCLUDE_MOJO_MACROS_H_
« no previous file with comments | « mojo/public/c/include/mojo/environment/logger.h ('k') | mojo/public/c/include/mojo/result.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698