Skip to content

Commit

Permalink
v.1.44.30 - Compile mimetex for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
xintrea committed Sep 14, 2018
1 parent cd69757 commit 3ca1e1d
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 9 deletions.
8 changes: 4 additions & 4 deletions app/app.pro
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ TARGET_OS=ANY_OS

# Build type
# "debug" or "release"
BUILD_TYPE="debug"
BUILD_TYPE="release"

# Enable console for Windows
# 0 - disable, 1 - enable
WINDOWS_CONSOLE_ENABLE=1
# 0 - disable, 1 - enable (this is for compile mytetra.exe and rename to mytetra_debug.exe)
WINDOWS_CONSOLE_ENABLE=0

# Profiling enable
# 0 - disable, 1 - enable
Expand Down Expand Up @@ -422,4 +422,4 @@ win32 {
MIMETEX_BINARY=mimetex
}

QMAKE_POST_LINK += $$copyToDir($${_PRO_FILE_PWD_}/../thirdParty/mimetex/build/bin/mimetex, $${OUT_PWD}/bin/$${MIMETEX_BINARY})
QMAKE_POST_LINK += $$copyToDir($${_PRO_FILE_PWD_}/../thirdParty/mimetex/build/bin/$${MIMETEX_BINARY}, $${OUT_PWD}/bin/$${MIMETEX_BINARY})
2 changes: 1 addition & 1 deletion app/src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ using namespace std;
// Версия программы
#define APPLICATION_RELEASE_VERSION 1
#define APPLICATION_RELEASE_SUBVERSION 44
#define APPLICATION_RELEASE_MICROVERSION 29
#define APPLICATION_RELEASE_MICROVERSION 30


// Поддерживаемая версия формата базы (хранилища)
Expand Down
39 changes: 37 additions & 2 deletions thirdParty/mimetex/mimetex.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,17 @@ Program id
/* -------------------------------------------------------------------------
header files and macros
-------------------------------------------------------------------------- */

// #define _GNU_SOURCE /* for strcasestr() in string.h */
// char *strcasestr(); /* non-standard extension */
// #define _GNU_SOURCE char *strcasestr(const char *haystack, const char *needle);
const char *strcasestr(const char *s1, const char *s2);

/* --- standard headers --- */
#include <stdio.h>
#include <stdlib.h>
/*#include <unistd.h>*/
#define _GNU_SOURCE /* for strcasestr() in string.h */
#include <string.h>
char *strcasestr(); /* non-standard extension */
#include <ctype.h>
#include <math.h>
#include <time.h>
Expand Down Expand Up @@ -18282,5 +18286,36 @@ return pixval;
#endif /* gif */
#endif /* driver */
#endif /* PART1 */


int mystrncmpi(const char* s1, const char* s2,int n)
{
int i=0;
while((s1[i]!='\0' || s2[i]!='\0') && i<n) {
if((s1[i]==s2[i])|| (s1[i]-s2[i])==32|| (s1[i]-s2[i])==- 32)
i++;
else
return(s1[i]-s2[i]);
}

return 0;
}

const char *strcasestr(const char *s1, const char *s2)
{
// if either pointer is null
if (s1 == 0 || s2 == 0)
return 0;
// the length of the needle
size_t n = strlen(s2);
// iterate through the string
while(*s1)
// if the compare which is case insensitive is a match, return the pointer
if(!mystrncmpi(s1++,s2,n))
return (s1-1);
// no match was found
return 0;
}

/* ======================= END-OF-FILE MIMETEX.C ========================= */

4 changes: 2 additions & 2 deletions thirdParty/mimetex/mimetex.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ QT-=gui

message(Touch mimeTeX qmake)

QMAKE_CFLAGS += -DAA
QMAKE_CXXFLAGS += -DAA
QMAKE_CFLAGS += -DAA -D_GNU_SOURCE
QMAKE_CXXFLAGS += -DAA -D_GNU_SOURCE

SOURCES=mimetex.c \
gifsave.c \
Expand Down

0 comments on commit 3ca1e1d

Please # to comment.