Skip to content

Commit

Permalink
Move dependecy check to source
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali-Mirghasemi committed Nov 30, 2024
1 parent 1d36ba1 commit 3672fd4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
12 changes: 12 additions & 0 deletions Src/InputStream.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
#include "InputStream.h"
#include <string.h>

#if ISTREAM

#if !STREAM_READ
#error "For using InputStream Library you must enable STREAM_READ in StreamBuffer.h"
#endif

#if !STREAM_PENDING_BYTES
#error "For using InputStream Library you must enable STREAM_PENDING_BYTES in StreamBuffer.h"
#endif

/**
* @brief Initialize InputStream
*
Expand Down Expand Up @@ -118,3 +128,5 @@ void IStream_onFull(IStream* stream, IStream_OnFullFn fn) {
stream->onFull = fn;
}
#endif

#endif // ISTREAM
18 changes: 4 additions & 14 deletions Src/InputStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ extern "C" {
/************************************************************************/
/* Configuration */
/************************************************************************/

/**
* @brief This lable shows OStream Libraty is enabled or not
*/
#define ISTREAM (1 && STREAM_READ && STREAM_PENDING_BYTES)
/**
* @brief enable checkTransmit function
*/
Expand All @@ -37,19 +40,6 @@ extern "C" {

/************************************************************************/

#if !STREAM_READ
#error "For using InputStream Library you must enable STREAM_READ in StreamBuffer.h"
#endif

#if !STREAM_PENDING_BYTES
#error "For using InputStream Library you must enable STREAM_PENDING_BYTES in StreamBuffer.h"
#endif

/**
* @brief This lable shows OStream Libraty is enabled or not
*/
#define ISTREAM (STREAM_READ && STREAM_PENDING_BYTES)

/**
* @brief show stream version in string format
*/
Expand Down

0 comments on commit 3672fd4

Please sign in to comment.