Skip to content

Commit

Permalink
fixed how VASQ_REJECT_PLACHOLDER works; PLACEHOLDER() no longer depen…
Browse files Browse the repository at this point in the history
…ds upon features.h
  • Loading branch information
nickeldan committed Oct 8, 2021
1 parent b941aa6 commit 812edd2
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 23 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
deps.mk
logger_test
snprintf_test
assert_test
README.pdf
.vscode
.vscode
7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Vanilla Squad

:Author: Daniel Walker

Version 5.1.0 was released on October 3, 2021.
Version 5.1.1 was released on October 8, 2021.

Overview
========
Expand Down Expand Up @@ -175,8 +175,9 @@ Placeholders
============

placeholder.h defines a single macro: **PLACEHOLDER()**. If either the **DEBUG** or
**VASQ_ALLOW_PLACEHOLDER** macros are defined, then **PLACEHOLDER()** will resolve to a no op. Otherwise,
it will resolve to a compiler error. The intended use case is
**VASQ_ALLOW_PLACEHOLDER** macros are defined and **VASQ_REJECT_PLACEHOLDER** is not defined, then
**PLACEHOLDER()** will resolve to a no op. Otherwise, it will resolve to a compiler error. The intended use
case is

.. code-block:: c
Expand Down
4 changes: 4 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
5.1.1:
- The PLACEHOLDER() macro no longer depends upon features.h.
- Fixed how VASQ_REJECT_PLACEHOLDER works.

5.1.0:
- Remove some writes to stderr which occurred when vasqLoggerCreate failed.
- Added the VASQ_ASSERT macro.
Expand Down
2 changes: 1 addition & 1 deletion include/vasq/definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* @brief Current version of the library.
*/
#define VASQ_VERSION "5.1.0"
#define VASQ_VERSION "5.1.1"

#ifndef NO_OP
#define NO_OP ((void)0)
Expand Down
22 changes: 4 additions & 18 deletions include/vasq/placeholder.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,25 @@
#ifndef VANILLA_SQUAD_PLACEHOLDER_H
#define VANILLA_SQUAD_PLACEHOLDER_H

#include <features.h>

#include "config.h"
#include "definitions.h"

#ifdef __USE_ISOC99

#if (defined(DEBUG) || defined(VASQ_ALLOW_PLACEHOLDER)) && !defined(VASQ_REJECT_PLACEHOLDER)
#if defined(VASQ_REJECT_PLACEHOLDER) || (!defined(DEBUG) && !defined(VASQ_ALLOW_PLACEHOLDER))

#ifdef VASQ_WARN_PLACEHOLDER
#define PLACEHOLDER() _Pragma("GCC error \"Placeholder code left in project.\"")

#ifdef VASQ_REJECT_PLACEHOLDER
#warning "VASQ_WARN_PLACEHOLDER and VASQ_REJECT_PLACEHOLDER are both defined."
#endif
#elif defined(VASQ_WARN_PLACEHOLDER)

#define PLACEHOLDER() _Pragma("GCC warning \"Placeholder code left in project.\"")

#else // VASQ_WARN_PLACEHOLDER
#else

#define PLACEHOLDER() NO_OP

#endif // VASQ_WARN_PLACEHOLDER

#else // (defined(DEBUG) || defined(VASQ_ALLOW_PLACEHOLDER)) && !defined(VASQ_REJECT_PLACEHOLDER)

#ifdef VASQ_ALLOW_PLACEHOLDER
#warning "VASQ_ALLOW_PLACEHOLDER and VASQ_REJECT_PLACEHOLDER are both defined."
#endif

#define PLACEHOLDER() _Pragma("GCC error \"Placeholder code left in project.\"")

#endif // (defined(DEBUG) || defined(VASQ_ALLOW_PLACEHOLDER)) && !defined(VASQ_REJECT_PLACEHOLDER)

#else // __USE_ISOC99

#warning "_Pragma not defined and so PLACEHOLDER() will not work."
Expand Down

0 comments on commit 812edd2

Please sign in to comment.