Kaydet (Commit) 2e76e379 authored tarafından Thomas Martitz's avatar Thomas Martitz

win32: port some defines from win32-config.h & waf to a new win32defines.h

autotools based build system uses only config.h. This file was lacking some
important defines. Rather than maintaining the defines in all build systems,
we can simply define in a specialized header that is included by all .c files
that use windows.h
üst ba80af08
......@@ -147,7 +147,7 @@ WINDRES = $(host_alias)-windres
geany_private.res: $(top_srcdir)/geany_private.rc
$(WINDRES) -i $(top_srcdir)/geany_private.rc --input-format=rc -o $@ -O coff
libgeany_la_SOURCES += win32.c win32.h
libgeany_la_SOURCES += win32.c win32.h win32defines.h
libgeany_la_LIBADD += -lole32 -lwsock32 -lcomdlg32
libgeany_la_LDFLAGS += -Wl,-luuid -mwindows -mms-bitfields -no-undefined
......
......@@ -79,6 +79,7 @@
# include <netinet/in.h>
# include <glib/gstdio.h>
#else
# include "win32defines.h"
# include <winsock2.h>
# include <windows.h>
# include <gdk/gdkwin32.h>
......
......@@ -49,6 +49,7 @@
#include "spawn.h"
#ifdef G_OS_WIN32
# include "win32defines.h"
# include <ctype.h> /* isspace() */
# include <fcntl.h> /* _O_RDONLY, _O_WRONLY */
# include <io.h> /* _open_osfhandle, _close */
......
......@@ -31,6 +31,8 @@
#ifdef G_OS_WIN32
#include "win32defines.h"
#include "dialogs.h"
#include "document.h"
#include "editor.h"
......@@ -47,8 +49,6 @@
#include <stdlib.h>
#include <string.h>
#define VC_EXTRALEAN
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <commdlg.h>
#include <shellapi.h>
......
/*
* win32defines.h - this file is part of Geany, a fast and lightweight IDE
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef WIN32DEFINES_H
#define WIN32DEFINES_H 1
/* These defines are necessary defines *before* windows.h is included */
#define VC_EXTRALEAN
#define WIN32_LEAN_AND_MEAN
/* Need Windows XP for SHGetFolderPathAndSubDirW */
#define WINVER 0x0501
/* Needed for SHGFP_TYPE */
#define _WIN32_IE 0x0500
#endif /* WIN32DEFINES_H */
......@@ -317,9 +317,3 @@
/* Define if you want to detect a running instance */
#define HAVE_SOCKET 1
// Need Windows XP for SHGetFolderPathAndSubDirW
#define WINVER 0x0501
// Needed for SHGFP_TYPE
#define _WIN32_IE 0x0500
......@@ -274,9 +274,6 @@ but you then may not have a local copy of the HTML manual.'''
'-static-libgcc',
'-static-libstdc++'])
conf.env.append_value('LIB_WIN32', ['wsock32', 'uuid', 'ole32', 'comdlg32'])
# explicitly define Windows version for older Mingw environments
conf.define('WINVER', '0x0501', quote=False) # for SHGetFolderPathAndSubDirW
conf.define('_WIN32_IE', '0x0500', quote=False) # for SHGFP_TYPE
else:
conf.env['cshlib_PATTERN'] = '%s.so'
# DATADIR and LOCALEDIR are defined by the intltool tool
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment