summaryrefslogtreecommitdiffstats
path: root/src/H5win32defs.h
blob: 26bca675348c092c038f15902ff8cb66ac5fb0e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Copyright by The HDF Group.                                               *
 * Copyright by the Board of Trustees of the University of Illinois.         *
 * All rights reserved.                                                      *
 *                                                                           *
 * This file is part of HDF5.  The full HDF5 copyright notice, including     *
 * terms governing use, modification, and redistribution, is contained in    *
 * the COPYING file, which can be found at the root of the source code       *
 * distribution tree, or in https://www.hdfgroup.org/licenses.               *
 * If you do not have access to either file, you may request a copy from     *
 * help@hdfgroup.org.                                                        *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

/* Purpose: This file is used to map HDF macros to Windows functions.  This
 *          should get included H5private mappings, so as to override them.
 *          Any macro not mapped here, however, will receive a similar mapping
 *          inside H5private.h
 *
 */

/* _MSC_VER = 192x  VS2019
 * _MSC_VER = 191x  VS2017
 * _MSC_VER = 1900  VS2015
 * _MSC_VER = 1800  VS2013
 * _MSC_VER = 1700  VS2012
 */
#ifdef H5_HAVE_WIN32_API

typedef struct _stati64 h5_stat_t;
typedef __int64         h5_stat_size_t;

#define HDaccess(F, M) _access(F, M)
#define HDchdir(S)     _chdir(S)
#define HDclose(F)     _close(F)
#define HDcreat(S, M)  Wopen_utf8(S, O_CREAT | O_TRUNC | O_RDWR, M)
#define HDdup(F)       _dup(F)
#define HDfdopen(N, S) _fdopen(N, S)
#define HDfileno(F)    _fileno(F)
#define HDfstat(F, B)  _fstati64(F, B)
#define HDisatty(F)    _isatty(F)

#define HDgetcwd(S, Z)     _getcwd(S, Z)
#define HDgetdcwd(D, S, Z) _getdcwd(D, S, Z)
#define HDgetdrive()       _getdrive()
#define HDlseek(F, O, W)   _lseeki64(F, O, W)
#define HDlstat(S, B)      _lstati64(S, B)
#define HDmkdir(S, M)      _mkdir(S)
#define HDoff_t            __int64

/* Note that the variadic HDopen macro is using a VC++ extension
 * where the comma is dropped if nothing is passed to the ellipsis.
 */
#ifndef H5_HAVE_MINGW
#define HDopen(S, F, ...) Wopen_utf8(S, F, __VA_ARGS__)
#else
#define HDopen(S, F, ...) Wopen_utf8(S, F, ##__VA_ARGS__)
#endif
#define HDread(F, M, Z)       _read(F, M, Z)
#define HDremove(S)           Wremove_utf8(S)
#define HDrmdir(S)            _rmdir(S)
#define HDsetvbuf(F, S, M, Z) setvbuf(F, S, M, (Z > 1 ? Z : 2))
#define HDsleep(S)            Sleep(S * 1000)
#define HDstat(S, B)          _stati64(S, B)
#define HDstrcasecmp(A, B)    _stricmp(A, B)
#define HDstrdup(S)           _strdup(S)
#define HDstrtok_r(X, Y, Z)   strtok_s(X, Y, Z)
#define HDtzset()             _tzset()
#define HDunlink(S)           _unlink(S)
#define HDwrite(F, M, Z)      _write(F, M, Z)

#ifdef H5_HAVE_VISUAL_STUDIO

/*
 * The (void*) cast just avoids a compiler warning in MSVC
 */
#define HDmemset(X, C, Z) memset((void *)(X), C, Z)

struct timezone {
    int tz_minuteswest;
    int tz_dsttime;
};

#endif /* H5_HAVE_VISUAL_STUDIO */

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
H5_DLL int    Wgettimeofday(struct timeval *tv, struct timezone *tz);
H5_DLL int    Wsetenv(const char *name, const char *value, int overwrite);
H5_DLL int    Wflock(int fd, int operation);
H5_DLL char * Wgetlogin(void);
H5_DLL herr_t H5_expand_windows_env_vars(char **env_var);
H5_DLL wchar_t *H5_get_utf16_str(const char *s);
H5_DLL int      Wopen_utf8(const char *path, int oflag, ...);
H5_DLL int      Wremove_utf8(const char *path);
H5_DLL int      H5_get_win32_times(H5_timevals_t *tvs);
#ifdef __cplusplus
}
#endif /* __cplusplus */

#define HDgettimeofday(V, Z) Wgettimeofday(V, Z)
#define HDsetenv(N, V, O)    Wsetenv(N, V, O)
#define HDunsetenv(N, V, O)  Wsetenv(N, "", 1)
#define HDflock(F, L)        Wflock(F, L)
#define HDgetlogin()         Wgetlogin()

/* Non-POSIX functions */

#ifndef H5_HAVE_MINGW
#define HDftruncate(F, L) _chsize_s(F, L)
#define HDfseek(F, O, W)  _fseeki64(F, O, W)
#endif /* H5_HAVE_MINGW */

#endif /* H5_HAVE_WIN32_API */
ption value='dkf_documentation_figures'>dkf_documentation_figures Tcl is a high-level, general-purpose, interpreted, dynamic programming language. It was designed with the goal of being very simple but powerful.
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2006-09-26 23:01:10 (GMT)
committerKevin B Kenny <kennykb@acm.org>2006-09-26 23:01:10 (GMT)
commitb725003f03a39521f6ea93c9ee3f7a688eb96674 (patch)
tree0ce810c294bb948261ddbab693ef6d314cde3a0d
parent6142afe35274394fb66bf8ec381f250f4cb9dd11 (diff)
downloadtcl-b725003f03a39521f6ea93c9ee3f7a688eb96674.zip
tcl-b725003f03a39521f6ea93c9ee3f7a688eb96674.tar.gz
tcl-b725003f03a39521f6ea93c9ee3f7a688eb96674.tar.bz2
TIP 27 changes for Tcl_CreateEncoding
Diffstat
-rw-r--r--ChangeLog7
-rw-r--r--doc/Encoding.36
-rw-r--r--generic/tcl.decls4
-rw-r--r--generic/tclDecls.h6
-rw-r--r--generic/tclEncoding.c4
5 files changed, 17 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 1fcf3c2..78a39c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-09-26 Kevin Kenny <kennykb@acm.org>
+
+ * doc/Encoding.3: Added covariant 'const' qualifier for the
+ * generic/tcl.decls: Tcl_EncodingType argument to
+ * generic/tclEncoding.c: Tcl_CreateEncoding. [Further TIP#27 work.]
+ * generic/tclDecls.h: Reran 'make genstubs'.
+
2006-09-26 Pat Thoyts <patthoyts@users.sourceforge.net>
* win/makefile.vc: Additional compiler flags and amd64 support.
diff --git a/doc/Encoding.3 b/doc/Encoding.3
index 940eb56..00b9cef 100644
--- a/doc/Encoding.3
+++ b/doc/Encoding.3
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: Encoding.3,v 1.23 2006/02/08 22:37:50 dgp Exp $
+'\" RCS: @(#) $Id: Encoding.3,v 1.24 2006/09/26 23:01:10 kennykb Exp $
'\"
.so man.macros
.TH Tcl_GetEncoding 3 "8.1" Tcl "Tcl Library Procedures"
@@ -77,7 +77,7 @@ const char *
void
\fBTcl_SetDefaultEncodingDir\fR(\fIpath\fR)
.SH ARGUMENTS
-.AS Tcl_EncodingState *dstWrotePtr in/out
+.AS "const Tcl_EncodingType" *dstWrotePtr in/out
.AP Tcl_Interp *interp in
Interpreter to use for error reporting, or NULL if no error reporting is
desired.
@@ -150,7 +150,7 @@ stored in the output buffer. May be NULL.
.VS 8.5
Storage for the prescribed system encoding name.
.VE 8.5
-.AP Tcl_EncodingType *typePtr in
+.AP "const Tcl_EncodingType" *typePtr in
Structure that defines a new type of encoding.
.AP Tcl_Obj *searchPath in
.VS 8.5
diff --git a/generic/tcl.decls b/generic/tcl.decls