Skip to content

Commit

Permalink
Move m_typeof to core module.
Browse files Browse the repository at this point in the history
  • Loading branch information
P-p-H-d committed Oct 30, 2024
1 parent bc8098b commit 0e09681
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
12 changes: 11 additions & 1 deletion m-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@
# define M_ATTR_COLD_FUNCTION
#endif


/* Prefetch . */
#if defined(__GNUC__)
# define M_PREFETCH(p) __builtin_prefetch((p), 0, 0)
Expand All @@ -153,6 +152,17 @@
} while (0)
#endif

/* Definition of the typeof keyword
In C23, we can use the standard keyword.
Otherwise we use some extensions of the compilers. */
#ifdef _MSC_VER
#define m_typeof(x) decltype(x)
#elif defined(__GNUC__)
#define m_typeof(x) __typeof__(x)
#else
#define m_typeof(x) typeof(x)
#endif

/* Ignore some warnings detected by some compilers in the library.
* Whatever we do, there is some warnings that cannot be fixed.
* So they are ignored in order to avoid polluting the user with
Expand Down
11 changes: 0 additions & 11 deletions m-generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,6 @@
/********************************** INTERNAL *********************************/
/*****************************************************************************/

/* Definition of the typeof keyword
In C23, we can use the standard keyword.
Otherwise we use some extensions of the compilers. */
#ifdef _MSC_VER
#define m_typeof(x) decltype(x)
#elif defined(__GNUC__)
#define m_typeof(x) __typeof__(x)
#else
#define m_typeof(x) typeof(x)
#endif

// Instead of using expensive M_SEQ(1,50), precompute it:
#define M_G3N_SEQ_INT \
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, \
Expand Down

0 comments on commit 0e09681

Please sign in to comment.