Fossil SCM

Consolidate all the Cygwin-specific preprocessor directives into one file and include it where necessary.

mistachkin 2013-10-04 02:50 trunk
Commit 816e893d3b6563d1c82d023a036af23eb6a2035d
+1 -6
--- src/add.c
+++ src/add.c
@@ -20,16 +20,11 @@
2020
*/
2121
#include "config.h"
2222
#include "add.h"
2323
#include <assert.h>
2424
#include <dirent.h>
25
-#ifdef __CYGWIN__
26
- __declspec(dllimport) extern __stdcall int RegOpenKeyExW(void *, void *,
27
- int, int, void *);
28
- __declspec(dllimport) extern __stdcall int RegQueryValueExW(void *, void *,
29
- int, void *, void *, void *);
30
-#endif
25
+#include "cygsup.h"
3126
3227
/*
3328
** This routine returns the names of files in a working checkout that
3429
** are created by Fossil itself, and hence should not be added, deleted,
3530
** or merge, and should be omitted from "clean" and "extra" lists.
3631
--- src/add.c
+++ src/add.c
@@ -20,16 +20,11 @@
20 */
21 #include "config.h"
22 #include "add.h"
23 #include <assert.h>
24 #include <dirent.h>
25 #ifdef __CYGWIN__
26 __declspec(dllimport) extern __stdcall int RegOpenKeyExW(void *, void *,
27 int, int, void *);
28 __declspec(dllimport) extern __stdcall int RegQueryValueExW(void *, void *,
29 int, void *, void *, void *);
30 #endif
31
32 /*
33 ** This routine returns the names of files in a working checkout that
34 ** are created by Fossil itself, and hence should not be added, deleted,
35 ** or merge, and should be omitted from "clean" and "extra" lists.
36
--- src/add.c
+++ src/add.c
@@ -20,16 +20,11 @@
20 */
21 #include "config.h"
22 #include "add.h"
23 #include <assert.h>
24 #include <dirent.h>
25 #include "cygsup.h"
 
 
 
 
 
26
27 /*
28 ** This routine returns the names of files in a working checkout that
29 ** are created by Fossil itself, and hence should not be added, deleted,
30 ** or merge, and should be omitted from "clean" and "extra" lists.
31
+1 -5
--- src/cgi.c
+++ src/cgi.c
@@ -40,15 +40,11 @@
4040
#include <time.h>
4141
#include <stdio.h>
4242
#include <stdlib.h>
4343
#include <unistd.h>
4444
#include "cgi.h"
45
-#ifdef __CYGWIN__
46
-# include <wchar.h>
47
- __declspec(dllimport) extern __stdcall int ShellExecuteW(void *, void *,
48
- void *, void *, void *, int);
49
-#endif
45
+#include "cygsup.h"
5046
5147
#if INTERFACE
5248
/*
5349
** Shortcuts for cgi_parameter. P("x") returns the value of query parameter
5450
** or cookie "x", or NULL if there is no such parameter or cookie. PD("x","y")
5551
5652
ADDED src/cygsup.h
--- src/cgi.c
+++ src/cgi.c
@@ -40,15 +40,11 @@
40 #include <time.h>
41 #include <stdio.h>
42 #include <stdlib.h>
43 #include <unistd.h>
44 #include "cgi.h"
45 #ifdef __CYGWIN__
46 # include <wchar.h>
47 __declspec(dllimport) extern __stdcall int ShellExecuteW(void *, void *,
48 void *, void *, void *, int);
49 #endif
50
51 #if INTERFACE
52 /*
53 ** Shortcuts for cgi_parameter. P("x") returns the value of query parameter
54 ** or cookie "x", or NULL if there is no such parameter or cookie. PD("x","y")
55
56 DDED src/cygsup.h
--- src/cgi.c
+++ src/cgi.c
@@ -40,15 +40,11 @@
40 #include <time.h>
41 #include <stdio.h>
42 #include <stdlib.h>
43 #include <unistd.h>
44 #include "cgi.h"
45 #include "cygsup.h"
 
 
 
 
46
47 #if INTERFACE
48 /*
49 ** Shortcuts for cgi_parameter. P("x") returns the value of query parameter
50 ** or cookie "x", or NULL if there is no such parameter or cookie. PD("x","y")
51
52 DDED src/cygsup.h
+68
--- a/src/cygsup.h
+++ b/src/cygsup.h
@@ -0,0 +1,68 @@
1
+/*
2
+** Copyright (c) 2007 D. Richard Hipp
3
+**
4
+** This program is free software; you can redistribute it and/or
5
+** modify it under the terms of the Simplified BSD License (also
6
+** known as the "2-Clause License" or "FreeBSD License".)
7
+
8
+** This program is distributed in the hope that it will be useful,
9
+** but without any warranty; without even the implied warranty of
10
+** merchantability or fitness for a particular purpose.
11
+**
12
+** Author contact information:
13
+** [email protected]
14
+** http://www.hwaci.com/drh/
15
+**
16
+*******************************************************************************
17
+**
18
+** This file contains preprocessor directives used to help integrate with the
19
+** Cygwin runtime and build environment. The intent of this file is to keep
20
+** the Cygwin-specific preprocessor directives together.
21
+*/
22
+
23
+#if defined(__CYGWIN__) && !defined(CYGSUP_H)
24
+#define CYGSUP_H
25
+
26
+/*
27
+*******************************************************************************
28
+** Include any Cygwin-specific headers here. **
29
+*******************************************************************************
30
+*/
31
+
32
+#include <wchar.h>
33
+#include <sys/cygwin.h>
34
+
35
+/*
36
+*******************************************************************************
37
+** Define any Cygwin-specific preprocessor macros here. All macros defined in
38
+** this section should be wrapped with #ifndef, in order to allow them to be
39
+** externally overridden.
40
+*******************************************************************************
41
+*/
42
+
43
+#ifndef CP_UTF8
44
+# define CP_UTF8 65001
45
+#endif
46
+
47
+#ifndef WINBASEAPI
48
+# define WINBASEAPI __declspec(dllimport)
49
+#endif
50
+
51
+#ifndef WINADVAPI
52
+# define WINADVAPI __declspec(dllimport)
53
+#endif
54
+
55
+#ifndef SHSTDAPI
56
+# define SHSTDAPI __declspec(dllimport)
57
+#endif
58
+
59
+#ifndef STDAPI
60
+# define STDAPI __stdcall
61
+#endif
62
+
63
+#ifndef WINAPI
64
+# define WINAPI __stdcall
65
+#endif
66
+
67
+/*
68
+*******************
--- a/src/cygsup.h
+++ b/src/cygsup.h
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/src/cygsup.h
+++ b/src/cygsup.h
@@ -0,0 +1,68 @@
1 /*
2 ** Copyright (c) 2007 D. Richard Hipp
3 **
4 ** This program is free software; you can redistribute it and/or
5 ** modify it under the terms of the Simplified BSD License (also
6 ** known as the "2-Clause License" or "FreeBSD License".)
7
8 ** This program is distributed in the hope that it will be useful,
9 ** but without any warranty; without even the implied warranty of
10 ** merchantability or fitness for a particular purpose.
11 **
12 ** Author contact information:
13 ** [email protected]
14 ** http://www.hwaci.com/drh/
15 **
16 *******************************************************************************
17 **
18 ** This file contains preprocessor directives used to help integrate with the
19 ** Cygwin runtime and build environment. The intent of this file is to keep
20 ** the Cygwin-specific preprocessor directives together.
21 */
22
23 #if defined(__CYGWIN__) && !defined(CYGSUP_H)
24 #define CYGSUP_H
25
26 /*
27 *******************************************************************************
28 ** Include any Cygwin-specific headers here. **
29 *******************************************************************************
30 */
31
32 #include <wchar.h>
33 #include <sys/cygwin.h>
34
35 /*
36 *******************************************************************************
37 ** Define any Cygwin-specific preprocessor macros here. All macros defined in
38 ** this section should be wrapped with #ifndef, in order to allow them to be
39 ** externally overridden.
40 *******************************************************************************
41 */
42
43 #ifndef CP_UTF8
44 # define CP_UTF8 65001
45 #endif
46
47 #ifndef WINBASEAPI
48 # define WINBASEAPI __declspec(dllimport)
49 #endif
50
51 #ifndef WINADVAPI
52 # define WINADVAPI __declspec(dllimport)
53 #endif
54
55 #ifndef SHSTDAPI
56 # define SHSTDAPI __declspec(dllimport)
57 #endif
58
59 #ifndef STDAPI
60 # define STDAPI __stdcall
61 #endif
62
63 #ifndef WINAPI
64 # define WINAPI __stdcall
65 #endif
66
67 /*
68 *******************
+1 -8
--- src/utf8.c
+++ src/utf8.c
@@ -23,18 +23,11 @@
2323
#include "utf8.h"
2424
#include <sqlite3.h>
2525
#ifdef _WIN32
2626
# include <windows.h>
2727
#endif
28
-#ifdef __CYGWIN__
29
-# include <sys/cygwin.h>
30
-# define CP_UTF8 65001
31
- __declspec(dllimport) extern __stdcall int WideCharToMultiByte(int, int,
32
- const char *, int, const char *, int, const char *, const char *);
33
- __declspec(dllimport) extern __stdcall int MultiByteToWideChar(int, int,
34
- const char *, int, wchar_t*, int);
35
-#endif
28
+#include "cygsup.h"
3629
3730
#ifdef _WIN32
3831
/*
3932
** Translate MBCS to UTF-8. Return a pointer to the translated text.
4033
** Call fossil_mbcs_free() to deallocate any memory used to store the
4134
--- src/utf8.c
+++ src/utf8.c
@@ -23,18 +23,11 @@
23 #include "utf8.h"
24 #include <sqlite3.h>
25 #ifdef _WIN32
26 # include <windows.h>
27 #endif
28 #ifdef __CYGWIN__
29 # include <sys/cygwin.h>
30 # define CP_UTF8 65001
31 __declspec(dllimport) extern __stdcall int WideCharToMultiByte(int, int,
32 const char *, int, const char *, int, const char *, const char *);
33 __declspec(dllimport) extern __stdcall int MultiByteToWideChar(int, int,
34 const char *, int, wchar_t*, int);
35 #endif
36
37 #ifdef _WIN32
38 /*
39 ** Translate MBCS to UTF-8. Return a pointer to the translated text.
40 ** Call fossil_mbcs_free() to deallocate any memory used to store the
41
--- src/utf8.c
+++ src/utf8.c
@@ -23,18 +23,11 @@
23 #include "utf8.h"
24 #include <sqlite3.h>
25 #ifdef _WIN32
26 # include <windows.h>
27 #endif
28 #include "cygsup.h"
 
 
 
 
 
 
 
29
30 #ifdef _WIN32
31 /*
32 ** Translate MBCS to UTF-8. Return a pointer to the translated text.
33 ** Call fossil_mbcs_free() to deallocate any memory used to store the
34

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button