32-bit support, compile wrapper

This commit is contained in:
biglyderv 2025-03-27 09:51:49 -04:00
parent dffdf200cc
commit 0e3dd1a83f
Signed by: biglyderv
GPG key ID: 0E2EB0B4CD7397B5
3 changed files with 12 additions and 32 deletions

4
.gitignore vendored
View file

@ -1,5 +1,7 @@
/bin/elem
/bin/elem.exe
/bin/elem_32.exe
/inv.txt
/inv_users.txt
/polls.txt
/polls.txt
/elem.tar.gz

View file

@ -46,16 +46,7 @@ int sort_comp(const void *a, const void *b) {
return strcmp(*(char **)a, *(char **)b);
}
#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || \
(defined(__APPLE__) && defined(__MACH__)))
int inv_handler(const void *key, unsigned long size, unsigned long val,
void *usr)
#else
int inv_handler(const void *key, unsigned long long size,
unsigned long long val, void *usr)
#endif
{
int inv_handler(const void *key, size_t size, uintptr_t val, void *usr) {
struct pager *i = usr;
i->i++;
if (i->i < i->page * 10 || i->i >= (i->page + 1) * 10) {
@ -73,19 +64,10 @@ int inv_handler(const void *key, unsigned long long size,
return 1;
}
#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || \
(defined(__APPLE__) && defined(__MACH__)))
int polls_handler(const void *key, unsigned long size, unsigned long val,
void *usr)
#else
int polls_handler(const void *key, unsigned long long size,
unsigned long long val, void *usr)
#endif
{
int polls_handler(const void *key, size_t size, uintptr_t val, void *usr) {
struct verifier *verified = (struct verifier *)usr;
if (((char*) val)[strlen(((char *)val)) - 1] == '\n') {
if (((char *)val)[strlen(((char *)val)) - 1] == '\n') {
((char *)val)[strlen(((char *)val)) - 1] = '\0';
}
@ -96,16 +78,7 @@ int polls_handler(const void *key, unsigned long long size,
return 0;
}
#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || \
(defined(__APPLE__) && defined(__MACH__)))
int success_handler(const void *key, unsigned long size, unsigned long val,
void *usr)
#else
int success_handler(const void *key, unsigned long long size,
unsigned long long val, void *usr)
#endif
{
int success_handler(const void *key, size_t size, uintptr_t val, void *usr) {
struct succ *verified = (struct succ *)usr;
if ((char *)val != verified->sugg) {

5
wrap.sh Executable file
View file

@ -0,0 +1,5 @@
make
CC=x86_64-w64-mingw32-gcc BIN=./bin/elem.exe make
CC=i686-w64-mingw32-gcc BIN=./bin/elem_32.exe make
rm ./elem.tar.gz
tar -cvf ./elem.tar.gz bin