Skip to content

Commit

Permalink
MERGEBACK
Browse files Browse the repository at this point in the history
  • Loading branch information
jgriffiths committed Oct 31, 2023
1 parent 61db7d3 commit 34d27b7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
CIBW_BEFORE_ALL_LINUX: yum install -y swig || apk add swig
CIBW_BEFORE_ALL_MACOS: brew install gnu-sed swig automake
CIBW_BEFORE_ALL_WINDOWS: choco install swig --version=3.0.12 --no-progress --allow-downgrade -y
CIBW_BEFORE_BUILD_WINDOWS: .\tools\msvc\wheel_preamble.bat
CIBW_BEFORE_BUILD_WINDOWS: .\tools\msvc\swig.bat
CIBW_REPAIR_WHEEL_COMMAND_LINUX: auditwheel repair --only-plat -w {dest_dir} {wheel}
LIBWALLY_DIR: "."
SWIG_PATH: "C:\\ProgramData\\chocolatey\\lib\\swig\\tools\\install\\swigwin-3.0.12"
Expand Down
6 changes: 0 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,6 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(void){static int a[2];return *((int*)((
have_unaligned=1, have_unaligned=0, have_unaligned=0)
AC_DEFINE_UNQUOTED([HAVE_UNALIGNED_ACCESS], [$have_unaligned], [Define if we have unaligned access])

if test "x$is_osx" != "xyes"; then
# Assume we are using gcc (i.e. have this attribute) if cross-compiling
AC_COMPILE_IFELSE([AC_LANG_SOURCE([extern int foo(int) __attribute__((weak)); int main(void){return 0;}])],
[AC_DEFINE([HAVE_ATTRIBUTE_WEAK], 1, [Define if we have __attribute__((weak))])])
fi

AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/mman.h>]],[[mmap(0,0,0,0,0,0)]])],
[AC_DEFINE(HAVE_MMAP, 1, [Define if we have mmap])])

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def call(args, cwd=abs_path):
include_dirs=include_dirs,
extra_compile_args=extra_compile_args,
sources=[
'src/swig_python/swig_wrap.c' if is_windows else 'src/swig_python/swig_python_wrap.c',
'src/swig_python/swig_python_wrap.c',
'src/amalgamation/combined.c',
'src/amalgamation/combined_ccan.c',
'src/amalgamation/combined_ccan2.c',
Expand Down
37 changes: 10 additions & 27 deletions src/amalgamation/windows_config/config.h
Original file line number Diff line number Diff line change
@@ -1,36 +1,19 @@
#ifndef LIBWALLYCORE_CONFIG_H
#define LIBWALLYCORE_CONFIG_H

/* config.h for Windows. Assumes a little-endian intel-ish target */
#include <stddef.h>

#define HAVE_ATTRIBUTE_WEAK 1
#define HAVE_BIG_ENDIAN 0
#define HAVE_BSWAP_64 0
#define HAVE_BYTESWAP_H 0
#define HAVE_DLFCN_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_LITTLE_ENDIAN 1
#define HAVE_MEMORY_H 1
#define HAVE_MMAP 1
#define HAVE_PTHREAD 1
#define HAVE_PTHREAD_PRIO_INHERIT 1
#define HAVE_PYTHON "2.7"
#define HAVE_STDINT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_UNISTD_H 1
#define STDC_HEADERS 1
#define VERSION "0.6"
#if (!defined(_SSIZE_T_DECLARED)) && (!defined(_ssize_t)) && (!defined(ssize_t))
#define ssize_t long long
#ifndef _WIN32
#error windows_config/config.h is only intended for windows builds
#endif

#define alignment_ok(p, n) ((size_t)(p) % (n) == 0)
#define HAVE_UNALIGNED_ACCESS 1

void wally_clear(void *p, size_t len);
#if (!defined(_SSIZE_T_DECLARED)) && (!defined(_ssize_t)) && (!defined(ssize_t))
#define ssize_t long long
#endif

#define CCAN_CLEAR_MEMORY(p, len) wally_clear(p, len)
#include "ccan_config.h"

#endif /*LIBWALLYCORE_CONFIG_H*/
#endif /* LIBWALLYCORE_CONFIG_H */
2 changes: 1 addition & 1 deletion tools/msvc/swig.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
REM You need to set SWIG_PATH to the location where the swig zip
REM file is expanded to
%SWIG_PATH%\swig -python -Isrc -I%SWIG_PATH%\Lib\python -DBUILD_ELEMENTS=1 src\swig_python\swig.i
%SWIG_PATH%\swig -python -Isrc -I%SWIG_PATH%\Lib\python -DBUILD_ELEMENTS=1 src\swig_python\swig.i -o src\swig_python\swig_python_wrap.c
copy src\swig_python\wallycore.py + src\swig_python\python_extra.py_in src\swig_python\wallycore\__init__.py /B
del src\swig_python\wallycore.py

0 comments on commit 34d27b7

Please sign in to comment.