File: general.h

package info (click to toggle)
lua-torch-torch7 0~20170926-g89ede3b-6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,336 kB
  • sloc: ansic: 19,550; makefile: 79; sh: 20
file content (29 lines) | stat: -rw-r--r-- 688 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef TORCH_GENERAL_INC
#define TORCH_GENERAL_INC

#include <stdlib.h>
#include <string.h>
#include <stddef.h>

#include "luaT.h"
#include "TH.h"

#if (defined(_MSC_VER) || defined(__MINGW32__))

#define snprintf _snprintf
#define popen _popen
#define pclose _pclose

#endif

#if LUA_VERSION_NUM >= 503
/* one can simply enable LUA_COMPAT_5_2 to be backward compatible.
However, this does not work when we are trying to use system-installed lua,
hence these redefines
*/
#define luaL_optlong(L,n,d)     ((long)luaL_optinteger(L, (n), (d)))
#define luaL_checklong(L,n)     ((long)luaL_checkinteger(L, (n)))
#define luaL_checkint(L,n)      ((int)luaL_checkinteger(L, (n)))
#endif

#endif