Skip to content

Commit

Permalink
[mod_cml] include lua headers before base.h
Browse files Browse the repository at this point in the history
to avoid (historical) conflict with IN and OUT macros used in lua
and openssl headers (since base.h includes openssl headers when present)
  • Loading branch information
gstrauss committed Dec 5, 2016
1 parent 431bc34 commit 445bc29
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 32 deletions.
28 changes: 11 additions & 17 deletions src/mod_cml_funcs.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
#include "first.h"

#include "buffer.h"
#include "server.h"
#include "log.h"
#include "plugin.h"
#include "response.h"

#include "mod_cml.h"
#include "mod_cml_funcs.h"

#include <sys/stat.h>
#include <time.h>

Expand All @@ -19,20 +10,23 @@
#include <dirent.h>
#include <stdio.h>

#include <lauxlib.h>

#include "mod_cml_funcs.h"
#include "mod_cml.h"

#include "buffer.h"
#include "server.h"
#include "log.h"
#include "plugin.h"
#include "response.h"

#include "md5.h"

#define HASHLEN 16
typedef unsigned char HASH[HASHLEN];
#define HASHHEXLEN 32
typedef char HASHHEX[HASHHEXLEN+1];
#ifdef USE_OPENSSL
#define IN const
#else
#define IN
#endif
#define OUT

#include <lauxlib.h>

int f_crypto_md5(lua_State *L) {
li_MD5_CTX Md5Ctx;
Expand Down
24 changes: 9 additions & 15 deletions src/mod_cml_lua.c
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
#include "first.h"

#include "mod_cml.h"
#include "mod_cml_funcs.h"
#include "log.h"

#include "stat_cache.h"
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>

#include <assert.h>
#include <stdio.h>
#include <errno.h>
#include <time.h>
#include <string.h>

#include "mod_cml_funcs.h"
#include "mod_cml.h"

#include "log.h"
#include "stat_cache.h"

#define HASHLEN 16
typedef unsigned char HASH[HASHLEN];
#define HASHHEXLEN 32
typedef char HASHHEX[HASHHEXLEN+1];
#ifdef USE_OPENSSL
#define IN const
#else
#define IN
#endif
#define OUT

#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>

static int lua_to_c_get_string(lua_State *L, const char *varname, buffer *b) {
int curelem = lua_gettop(L);
Expand Down

0 comments on commit 445bc29

Please sign in to comment.