Browse Source

[mod_cml] include lua headers before base.h

to avoid (historical) conflict with IN and OUT macros used in lua
and openssl headers (since base.h includes openssl headers when present)
personal/stbuehler/mod-csrf
Glenn Strauss 5 years ago
parent
commit
445bc2914a
  1. 28
      src/mod_cml_funcs.c
  2. 24
      src/mod_cml_lua.c

28
src/mod_cml_funcs.c

@ -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>
@ -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;

24
src/mod_cml_lua.c

@ -1,10 +1,8 @@
#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>
@ -12,20 +10,16 @@
#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);

Loading…
Cancel
Save