Skip to content

Commit

Permalink
Merge branch 'dhc/obj-c' into obj-c
Browse files Browse the repository at this point in the history
  • Loading branch information
dhcdht committed Mar 19, 2024
2 parents 9b0b2cf + 1d31e92 commit dbc9094
Show file tree
Hide file tree
Showing 1,663 changed files with 57,955 additions and 24,938 deletions.
254 changes: 160 additions & 94 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Windows Nuget Build

on:
push:
paths-ignore:
- 'CHANGES*'
- 'Doc/**'
- 'appveyor.yml'
pull_request:
branches: master
paths-ignore:
- 'CHANGES*'
- 'Doc/**'
- 'appveyor.yml'

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
build:

runs-on: windows-2019

steps:
- name: Checkout
uses: actions/checkout@v4
with:
show-progress: false
submodules: recursive

- name: Install Dependencies
shell: powershell
run: |
nuget install CMake-win64 -Version 3.15.5 -OutputDirectory C:\Tools\CMake
nuget install Bison -Version 3.7.4 -OutputDirectory C:\Tools\bison
nuget install PCRE2 -Version 10.39 -OutputDirectory C:\Tools\pcre2
- name: Build
shell: powershell
run: |
$env:PATH="C:\Tools\CMake\CMake-win64.3.15.5\bin;C:\Tools\bison\Bison.3.7.4\bin;" + $env:PATH
$PCRE_ROOT="C:\Tools\pcre2\PCRE2.10.39.0"
$PCRE_PLATFORM="x64"
$WORKING_DIR=(Get-Location).ToString() -replace "\\","/"
cmake -G "Visual Studio 16 2019" -A "x64" `
-DCMAKE_INSTALL_PREFIX="$WORKING_DIR/install2" `
-DCMAKE_C_FLAGS="/DPCRE2_STATIC" `
-DCMAKE_CXX_FLAGS="/DPCRE2_STATIC" `
-DPCRE2_INCLUDE_DIR="$PCRE_ROOT/include" `
-DPCRE2_LIBRARY="$PCRE_ROOT/lib/pcre2-8-static.lib" `
-S . -B build
cmake --build build --config Release
- name: Install
shell: powershell
run: |
cmake --install build --config Release
- name: Test
shell: powershell
working-directory: install2/bin
run: |
swig.exe -version
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ CCache/config.log
CCache/config.status
CCache/config_win32.h
Examples/Makefile
Examples/d/example.mk
Examples/guile/Makefile
Examples/test-suite/*/Makefile
Examples/xml/Makefile
Expand All @@ -81,7 +80,6 @@ Tools/javascript/Makefile
config.log
config.status
preinst-swig
swig.spec

# Build Artifacts
.dirstamp
Expand Down Expand Up @@ -160,6 +158,14 @@ Examples/java/doxygen/javadocs
Examples/test-suite/javascript/*/
*.gyp

# Lua
Examples/lua/dual/dual
Examples/lua/dual/swigluarun.h
Examples/lua/embed/embed
Examples/lua/embed2/embed2
Examples/lua/embed3/embed3
Examples/lua/embed3/swigluarun.h

# OCaml
Examples/test-suite/ocaml/*.ml*
Examples/test-suite/ocaml/*.cm*
Expand Down
14 changes: 7 additions & 7 deletions ANNOUNCE
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
*** ANNOUNCE: SWIG 4.1.0 (in progress) ***
*** ANNOUNCE: SWIG 4.2.1 (24 Feb 2024) ***

http://www.swig.org
https://www.swig.org

We're pleased to announce SWIG-4.1.0, the latest SWIG release.
We're pleased to announce SWIG-4.2.1, the latest SWIG release.

What is SWIG?
=============
Expand All @@ -19,20 +19,20 @@ and user interface development for large C/C++ systems.
Release Notes
=============
Detailed release notes are available with the release and are also
published on the SWIG web site at http://swig.org/release.html.
published on the SWIG web site at https://swig.org/release.html.

Availability
============
The release is available for download on Sourceforge at

http://prdownloads.sourceforge.net/swig/swig-4.1.0.tar.gz
https://prdownloads.sourceforge.net/swig/swig-4.2.1.tar.gz

A Windows version is also available at

http://prdownloads.sourceforge.net/swig/swigwin-4.1.0.zip
https://prdownloads.sourceforge.net/swig/swigwin-4.2.1.zip

Please report problems with this release to the swig-devel mailing list,
details at http://www.swig.org/mail.html.
details at https://www.swig.org/mail.html.

--- The SWIG Developers

18 changes: 10 additions & 8 deletions CCache/ccache.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,13 +735,15 @@ static void from_cache(int first)
}

/* send the cpp stderr, if applicable */
fd_cpp_stderr = open(cpp_stderr, O_RDONLY | O_BINARY);
if (fd_cpp_stderr != -1) {
copy_fd(fd_cpp_stderr, 2);
close(fd_cpp_stderr);
unlink(cpp_stderr);
free(cpp_stderr);
cpp_stderr = NULL;
if (cpp_stderr) {
fd_cpp_stderr = open(cpp_stderr, O_RDONLY | O_BINARY);
if (fd_cpp_stderr != -1) {
copy_fd(fd_cpp_stderr, 2);
close(fd_cpp_stderr);
unlink(cpp_stderr);
free(cpp_stderr);
cpp_stderr = NULL;
}
}

/* send the stderr */
Expand Down Expand Up @@ -1089,7 +1091,7 @@ static void process_args(int argc, char **argv)
}
*p = 0;
}
else {
else {
int len = p - default_depfile_name;

p = x_malloc(len + 3);
Expand Down
2 changes: 1 addition & 1 deletion CCache/ccache.yo
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ ccache was adapted to create ccache-swig for use with SWIG by William Fulton.

If you wish to report a problem or make a suggestion then please email
the SWIG developers on the swig-devel mailing list, see
url(http://www.swig.org/mail.html)(http://www.swig.org/mail.html)
url(https://www.swig.org/mail.html)(https://www.swig.org/mail.html)

ccache is released under the GNU General Public License version 2 or
later. Please see the file COPYING for license details.
Expand Down
5 changes: 4 additions & 1 deletion CCache/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ AC_CACHE_CHECK([for C99 vsnprintf],ccache_cv_HAVE_C99_VSNPRINTF,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void foo(const char *format, ...) {
va_list ap;
int len;
Expand All @@ -77,7 +80,7 @@ void foo(const char *format, ...) {
exit(0);
}
main() { foo("hello"); }
int main(void) { foo("hello"); }
]])],[ccache_cv_HAVE_C99_VSNPRINTF=yes],[ccache_cv_HAVE_C99_VSNPRINTF=no],[ccache_cv_HAVE_C99_VSNPRINTF=cross])])
if test x"$ccache_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
AC_DEFINE(HAVE_C99_VSNPRINTF, 1, [ ])
Expand Down
53 changes: 26 additions & 27 deletions CCache/mdfour.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
It assumes that a int is at least 32 bits long
*/

static struct mdfour *m;

#define MASK32 (0xffffffff)

#define F(X,Y,Z) ((((X)&(Y)) | ((~(X))&(Z))))
Expand All @@ -38,12 +36,12 @@ static struct mdfour *m;
#define ROUND3(a,b,c,d,k,s) a = lshift((a + H(b,c,d) + M[k] + 0x6ED9EBA1)&MASK32,s)

/* this applies md4 to 64 byte chunks */
static void mdfour64(uint32 *M)
static void mdfour64(struct mdfour *md, uint32 *M)
{
uint32 AA, BB, CC, DD;
uint32 A,B,C,D;

A = m->A; B = m->B; C = m->C; D = m->D;
A = md->A; B = md->B; C = md->C; D = md->D;
AA = A; BB = B; CC = C; DD = D;

ROUND1(A,B,C,D, 0, 3); ROUND1(D,A,B,C, 1, 7);
Expand Down Expand Up @@ -80,16 +78,16 @@ static void mdfour64(uint32 *M)
A &= MASK32; B &= MASK32;
C &= MASK32; D &= MASK32;

m->A = A; m->B = B; m->C = C; m->D = D;
md->A = A; md->B = B; md->C = C; md->D = D;
}

static void copy64(uint32 *M, const unsigned char *in)
{
int i;

for (i=0;i<16;i++)
M[i] = (in[i*4+3]<<24) | (in[i*4+2]<<16) |
(in[i*4+1]<<8) | (in[i*4+0]<<0);
M[i] = ((uint32)in[i*4+3]<<24) | ((uint32)in[i*4+2]<<16) |
((uint32)in[i*4+1]<<8) | ((uint32)in[i*4+0]<<0);
}

static void copy4(unsigned char *out,uint32 x)
Expand All @@ -111,15 +109,15 @@ void mdfour_begin(struct mdfour *md)
}


static void mdfour_tail(const unsigned char *in, int n)
static void mdfour_tail(struct mdfour *md, const unsigned char *in, int n)
{
unsigned char buf[128];
uint32 M[16];
uint32 b;

m->totalN += n;
md->totalN += n;

b = m->totalN * 8;
b = md->totalN * 8;

memset(buf, 0, 128);
if (n) memcpy(buf, in, n);
Expand All @@ -128,24 +126,22 @@ static void mdfour_tail(const unsigned char *in, int n)
if (n <= 55) {
copy4(buf+56, b);
copy64(M, buf);
mdfour64(M);
mdfour64(md, M);
} else {
copy4(buf+120, b);
copy64(M, buf);
mdfour64(M);
mdfour64(md, M);
copy64(M, buf+64);
mdfour64(M);
mdfour64(md, M);
}
}

void mdfour_update(struct mdfour *md, const unsigned char *in, int n)
{
uint32 M[16];

m = md;

if (in == NULL) {
mdfour_tail(md->tail, md->tail_len);
mdfour_tail(md, md->tail, md->tail_len);
return;
}

Expand All @@ -158,18 +154,18 @@ void mdfour_update(struct mdfour *md, const unsigned char *in, int n)
in += len;
if (md->tail_len == 64) {
copy64(M, md->tail);
mdfour64(M);
m->totalN += 64;
mdfour64(md, M);
md->totalN += 64;
md->tail_len = 0;
}
}

while (n >= 64) {
copy64(M, in);
mdfour64(M);
mdfour64(md, M);
in += 64;
n -= 64;
m->totalN += 64;
md->totalN += 64;
}

if (n) {
Expand All @@ -181,12 +177,10 @@ void mdfour_update(struct mdfour *md, const unsigned char *in, int n)

void mdfour_result(struct mdfour *md, unsigned char *out)
{
m = md;

copy4(out, m->A);
copy4(out+4, m->B);
copy4(out+8, m->C);
copy4(out+12, m->D);
copy4(out, md->A);
copy4(out+4, md->B);
copy4(out+8, md->C);
copy4(out+12, md->D);
}


Expand Down Expand Up @@ -272,7 +266,12 @@ static void file_checksum2(char *fname)
printf("\n");
}
#endif

/*
* To test:
* gcc -DTEST_MDFOUR mdfour.c -o mdfourexe && ./mdfourexe <somefile>
* then compare against a reference, such as:
* openssl dgst -md4 <somefile>
*/
int main(int argc, char *argv[])
{
file_checksum1(argv[1]);
Expand Down
Loading

0 comments on commit dbc9094

Please sign in to comment.