Skip to content

Commit

Permalink
🐛 Use preprocessing instructions to avoid redefining macros. #8
Browse files Browse the repository at this point in the history
  • Loading branch information
ADD-SP committed Oct 25, 2020
1 parent ab031c8 commit 566ae4a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
1 change: 0 additions & 1 deletion inc/ngx_http_waf_module_check.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <ngx_inet.h>
#include "ngx_http_waf_module_macro.h"
#include "ngx_http_waf_module_type.h"
// #include "uthash/src/uthash.h"
#include <uthash.h>
#ifndef __linux__
#include <io.h>
Expand Down
1 change: 0 additions & 1 deletion inc/ngx_http_waf_module_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <ngx_http.h>
#include <ngx_regex.h>
#include <ngx_inet.h>
// #include "uthash/src/uthash.h"
#include <uthash.h>
#include "ngx_http_waf_module_macro.h"
#include "ngx_http_waf_module_type.h"
Expand Down
24 changes: 19 additions & 5 deletions inc/ngx_http_waf_module_macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,33 @@
#define WHITE_URL_FILE ("white-url")
#define WHITE_REFERER_FILE ("white-referer")

#ifndef FALSE
#define FALSE (0)
#endif
#ifndef TRUE
#define TRUE (1)
#endif

#ifndef FALSE
#define FALSE (0)
#endif

#ifndef SUCCESS
#define SUCCESS (1)
#define PROCESSING (2)
#endif

#ifndef FAIL
#define FAIL (0)
#endif

#ifndef PROCESSING
#define PROCESSING (2)
#endif

#ifndef MATCHED
#define MATCHED (1)
#define NOT_MATCHED (0)
#endif

#ifndef NOT_MATCHED
#define NOT_MATCHED (0)
#endif

#define RULE_MAX_LEN (256 * 4 * 8)
#define INITIAL_SIZE (1024 * 1024 * 5)
Expand Down
1 change: 0 additions & 1 deletion inc/ngx_http_waf_module_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <ngx_http.h>
#include <ngx_regex.h>
#include <ngx_inet.h>
// #include "uthash/src/uthash.h"
#include <uthash.h>
#include "ngx_http_waf_module_macro.h"

Expand Down

0 comments on commit 566ae4a

Please sign in to comment.