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 5328465 commit 1d36ba1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
12 changes: 12 additions & 0 deletions Src/OutputStream.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
#include "OutputStream.h"
#include <string.h>

#if OSTREAM

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

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

/**
* @brief Initialize OutputStream
*
Expand Down Expand Up @@ -198,3 +208,5 @@ Stream_LenType OStream_space(OStream* stream) {
#endif // OSTREAM_CHECK_TRANSMIT
return Stream_space(&stream->Buffer);
}

#endif // OSTREAM
18 changes: 4 additions & 14 deletions Src/OutputStream.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 OSTREAM (1 && STREAM_WRITE && STREAM_PENDING_BYTES)
/**
* @brief enable checkTransmit function
*/
Expand All @@ -42,19 +45,6 @@ extern "C" {

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

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

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

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

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

0 comments on commit 1d36ba1

Please sign in to comment.