Skip to content

Commit

Permalink
Rely on bootstrap more to remove some Windows-specific code in some c…
Browse files Browse the repository at this point in the history
…ases.

Also: In preparation for UTF-8 fopen on MINGW/Windows. (Patching gnulib)
Note: It turns out the gnulib implementation of select/send/recv
causes the UI to be treacle slow (gxdraw.c). So don't use that.
  • Loading branch information
jtanx committed Jul 31, 2017
1 parent b17e780 commit 8efadf0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 36 deletions.
3 changes: 3 additions & 0 deletions bootstrap.conf
Expand Up @@ -42,11 +42,14 @@ gnulib_modules='
warnings
manywarnings
c-strtod
fopen
gethostname
getline
iconv
inet_ntop
localeconv
open
mkdir
progname
strcase
strtok_r
Expand Down
19 changes: 0 additions & 19 deletions fontforgeexe/fontview.c
Expand Up @@ -70,10 +70,6 @@
#include "gutils/unicodelibinfo.h"
#include "sfundo.h"

#if defined (__MINGW32__)
#include <windows.h>
#endif

#include "xvasprintf.h"


Expand Down Expand Up @@ -5814,21 +5810,6 @@ static void FVMenuCollabCloseLocalServer(GWindow gw, struct gmenuitem *UNUSED(mi
AskAndMaybeCloseLocalCollabServers();
}


#if defined(__MINGW32__)
//
// This is an imperfect implemenation of kill() for windows.
//
static int kill( int pid, int sig )
{
HANDLE hHandle;
hHandle = OpenProcess( PROCESS_ALL_ACCESS, 0, pid );
TerminateProcess( hHandle, 0 );
}
#endif



static void collablistcheck(GWindow gw, struct gmenuitem *mi, GEvent *UNUSED(e))
{
FontView *fv = (FontView *) GDrawGetUserData(gw);
Expand Down
5 changes: 0 additions & 5 deletions fontforgeexe/startui.c
Expand Up @@ -98,11 +98,6 @@ extern void setup_cocoa_app();
//# endif
#endif

#if defined(__MINGW32__)
#include <windows.h>
#define sleep(n) Sleep(1000 * (n))
#endif

#include "collabclientui.h"
#include "scripting.h"

Expand Down
25 changes: 13 additions & 12 deletions gdraw/gxdraw.c
Expand Up @@ -25,29 +25,24 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#if defined(__MINGW32__)
#include <winsock2.h>
#include <windows.h>
#ifdef __MINGW32__
# include <winsock2.h>
# include <windows.h>
#endif

#include "gxdrawP.h"
#include "gxcdrawP.h"

#include <stdlib.h>
#include <math.h>

#if !defined(__MINGW32__)
#include <unistd.h> /* for timers & select */
#endif
#include <sys/types.h> /* for timers & select */
#include <sys/time.h> /* for timers & select */
#include <signal.h> /* error handler */
#include <locale.h> /* for setting the X locale properly */

#ifdef HAVE_PTHREAD_H
# ifndef __MINGW32__
#include <sys/time.h> /* for timers & select */
#ifndef __MINGW32__
# include <sys/select.h> /* for timers & select */
# ifdef HAVE_PTHREAD_H
# include <sys/socket.h>
# include <sys/un.h>
# endif
#endif

Expand All @@ -56,6 +51,12 @@
#include "fontP.h"
#include <gresource.h>

/* Hack to get around gnulib. */
#ifdef __MINGW32__
# undef gettimeofday
# undef timeval
#endif

enum cm_type { cmt_default=-1, cmt_current, cmt_copy, cmt_private };

void GDrawIErrorRun(const char *fmt,...);
Expand Down

0 comments on commit 8efadf0

Please sign in to comment.