Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 93e4d19

Browse files
cgohlkejdh2358
authored andcommitted
windows x64 support in _tkagg.so
1 parent 37e492e commit 93e4d19

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/_tkagg.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ extern "C"
3434
#endif
3535
}
3636

37+
#if defined(_MSC_VER)
38+
# define SIZE_T_FORMAT "%Iu"
39+
#else
40+
# define SIZE_T_FORMAT "%zu"
41+
#endif
42+
3743

3844

3945
typedef struct
@@ -53,7 +59,7 @@ PyAggImagePhoto(ClientData clientdata, Tcl_Interp* interp,
5359
// vars for blitting
5460
PyObject* bboxo;
5561

56-
unsigned long aggl, bboxl;
62+
size_t aggl, bboxl;
5763
bool has_bbox;
5864
agg::int8u *destbuffer;
5965
double l, b, r, t;
@@ -83,7 +89,7 @@ PyAggImagePhoto(ClientData clientdata, Tcl_Interp* interp,
8389
return TCL_ERROR;
8490
}
8591
/* get array (or object that can be converted to array) pointer */
86-
if (sscanf(argv[2], "%lu", &aggl) != 1)
92+
if (sscanf(argv[2], SIZE_T_FORMAT, &aggl) != 1)
8793
{
8894
Tcl_AppendResult(interp, "error casting pointer", (char *) NULL);
8995
return TCL_ERROR;
@@ -109,7 +115,7 @@ PyAggImagePhoto(ClientData clientdata, Tcl_Interp* interp,
109115
}
110116

111117
/* check for bbox/blitting */
112-
if (sscanf(argv[4], "%lu", &bboxl) != 1)
118+
if (sscanf(argv[4], SIZE_T_FORMAT, &bboxl) != 1)
113119
{
114120
Tcl_AppendResult(interp, "error casting pointer", (char *) NULL);
115121
return TCL_ERROR;

0 commit comments

Comments
 (0)