diff options
author | fvogel <fvogelnew1@free.fr> | 2023-01-14 11:10:28 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2023-01-14 11:10:28 (GMT) |
commit | cdc8d2fa8d71e9a6f9e452006cc7b10acc9ab930 (patch) | |
tree | 6ab96bcbd5bdc6edfaaa6ad37e52bbeb066e98a1 /generic | |
parent | 2d4a3f8ce9a84fd47a0b8586f5b2f62c282a3c95 (diff) | |
download | tk-cdc8d2fa8d71e9a6f9e452006cc7b10acc9ab930.zip tk-cdc8d2fa8d71e9a6f9e452006cc7b10acc9ab930.tar.gz tk-cdc8d2fa8d71e9a6f9e452006cc7b10acc9ab930.tar.bz2 |
Factorise definition of snprintf in tkWinInt.h (MSVC before 2015 didn't know snprintf).
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkBind.c | 8 | ||||
-rw-r--r-- | generic/tkBitmap.c | 12 | ||||
-rw-r--r-- | generic/tkBusy.c | 8 | ||||
-rw-r--r-- | generic/tkCanvLine.c | 8 | ||||
-rw-r--r-- | generic/tkCanvUtil.c | 8 | ||||
-rw-r--r-- | generic/tkCmds.c | 8 | ||||
-rw-r--r-- | generic/tkColor.c | 8 | ||||
-rw-r--r-- | generic/tkConfig.c | 8 | ||||
-rw-r--r-- | generic/tkCursor.c | 8 | ||||
-rw-r--r-- | generic/tkEntry.c | 8 | ||||
-rw-r--r-- | generic/tkFont.c | 8 | ||||
-rw-r--r-- | generic/tkImage.c | 8 | ||||
-rw-r--r-- | generic/tkImgPPM.c | 8 | ||||
-rw-r--r-- | generic/tkImgPhInstance.c | 8 | ||||
-rw-r--r-- | generic/tkOldConfig.c | 8 | ||||
-rw-r--r-- | generic/tkOldTest.c | 8 | ||||
-rw-r--r-- | generic/tkScale.c | 9 | ||||
-rw-r--r-- | generic/tkSelect.c | 8 | ||||
-rw-r--r-- | generic/tkTest.c | 8 | ||||
-rw-r--r-- | generic/tkTextDisp.c | 8 | ||||
-rw-r--r-- | generic/tkTextImage.c | 8 | ||||
-rw-r--r-- | generic/tkTextIndex.c | 8 | ||||
-rw-r--r-- | generic/tkUtil.c | 8 | ||||
-rw-r--r-- | generic/ttk/ttkCache.c | 8 | ||||
-rw-r--r-- | generic/ttk/ttkEntry.c | 8 | ||||
-rw-r--r-- | generic/ttk/ttkTreeview.c | 8 |
26 files changed, 46 insertions, 167 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c index 830e429..0cf887d 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -31,14 +31,6 @@ # define DEBUG(expr) expr #endif -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf -#endif - #define SIZE_OF_ARRAY(arr) (sizeof(arr)/sizeof(arr[0])) /* diff --git a/generic/tkBitmap.c b/generic/tkBitmap.c index 6e046c7..332e583 100644 --- a/generic/tkBitmap.c +++ b/generic/tkBitmap.c @@ -14,6 +14,10 @@ #include "tkInt.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + /* * The includes below are for pre-defined bitmaps. * @@ -42,14 +46,6 @@ #pragma warning (default : 4305) #endif -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf -#endif - /* * One of the following data structures exists for each bitmap that is * currently in use. Each structure is indexed with both "idTable" and diff --git a/generic/tkBusy.c b/generic/tkBusy.c index 075b892..32db4fc 100644 --- a/generic/tkBusy.c +++ b/generic/tkBusy.c @@ -16,12 +16,8 @@ #include "tkBusy.h" #include "default.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif /* diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c index 642d1c2..de46813 100644 --- a/generic/tkCanvLine.c +++ b/generic/tkCanvLine.c @@ -15,12 +15,8 @@ #include "tkCanvas.h" #include "default.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif /* diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c index 5e586ab..310df53 100644 --- a/generic/tkCanvUtil.c +++ b/generic/tkCanvUtil.c @@ -13,12 +13,8 @@ #include "tkInt.h" #include "tkCanvas.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif /* diff --git a/generic/tkCmds.c b/generic/tkCmds.c index 20e8c48..a642137 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.c @@ -22,14 +22,6 @@ #include "tkUnixInt.h" #endif -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf -#endif - /* * Forward declarations for functions defined later in this file: */ diff --git a/generic/tkColor.c b/generic/tkColor.c index 3a097ed..bc4c30c 100644 --- a/generic/tkColor.c +++ b/generic/tkColor.c @@ -15,12 +15,8 @@ #include "tkInt.h" #include "tkColor.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif /* diff --git a/generic/tkConfig.c b/generic/tkConfig.c index 1ff5c65..9e4c875 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -26,12 +26,8 @@ #include "tkInt.h" #include "tkFont.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif /* diff --git a/generic/tkCursor.c b/generic/tkCursor.c index 9f06843..50c6803 100644 --- a/generic/tkCursor.c +++ b/generic/tkCursor.c @@ -14,12 +14,8 @@ #include "tkInt.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif /* diff --git a/generic/tkEntry.c b/generic/tkEntry.c index fc574a0..86b79ac 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -19,12 +19,8 @@ #include "default.h" #include "tkEntry.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif /* diff --git a/generic/tkFont.c b/generic/tkFont.c index 873ec43..ea8cd20 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -17,12 +17,8 @@ #include "tkMacOSXInt.h" /* Defines TK_DRAW_IN_CONTEXT */ #endif -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif /* diff --git a/generic/tkImage.c b/generic/tkImage.c index 54a0fe1..8cd5519 100644 --- a/generic/tkImage.c +++ b/generic/tkImage.c @@ -13,12 +13,8 @@ #include "tkInt.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif /* diff --git a/generic/tkImgPPM.c b/generic/tkImgPPM.c index 54fe5cf..fe76e36 100644 --- a/generic/tkImgPPM.c +++ b/generic/tkImgPPM.c @@ -16,12 +16,8 @@ #include "tkInt.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif /* diff --git a/generic/tkImgPhInstance.c b/generic/tkImgPhInstance.c index 4fe7436..05fa40c 100644 --- a/generic/tkImgPhInstance.c +++ b/generic/tkImgPhInstance.c @@ -21,12 +21,8 @@ #include "tkImgPhoto.h" #include "tkPort.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif /* diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c index 5d8a042..fe27ef6 100644 --- a/generic/tkOldConfig.c +++ b/generic/tkOldConfig.c @@ -14,12 +14,8 @@ #include "tkInt.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif /* diff --git a/generic/tkOldTest.c b/generic/tkOldTest.c index 9662e26..1c0c575 100644 --- a/generic/tkOldTest.c +++ b/generic/tkOldTest.c @@ -24,12 +24,8 @@ #endif #include "tkInt.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif /* diff --git a/generic/tkScale.c b/generic/tkScale.c index 7026821..2d6502d 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -21,15 +21,10 @@ #include "tkInt.h" #include "tkScale.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif - /* * The following table defines the legal values for the -orient option. It is * used together with the "enum orient" declaration in tkScale.h. diff --git a/generic/tkSelect.c b/generic/tkSelect.c index 4a84e57..1f0214e 100644 --- a/generic/tkSelect.c +++ b/generic/tkSelect.c @@ -14,12 +14,8 @@ #include "tkInt.h" #include "tkSelect.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif /* diff --git a/generic/tkTest.c b/generic/tkTest.c index 75dec6c..96793df 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -28,14 +28,6 @@ #include "tkWinInt.h" #endif -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf -#endif - #if defined(MAC_OSX_TK) #include "tkMacOSXInt.h" #include "tkScrollbar.h" diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 3c2c799..b23c6f2 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -29,14 +29,6 @@ #define OK_TO_LOG 1 #endif -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf -#endif - /* * "Calculations of line pixel heights and the size of the vertical * scrollbar." diff --git a/generic/tkTextImage.c b/generic/tkTextImage.c index feff1ec..4f1b284 100644 --- a/generic/tkTextImage.c +++ b/generic/tkTextImage.c @@ -13,12 +13,8 @@ #include "tkPort.h" #include "tkText.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif /* diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index c371530..cb7ba7b 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -15,12 +15,8 @@ #include "tkText.h" #include "default.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif /* diff --git a/generic/tkUtil.c b/generic/tkUtil.c index 73a323b..a673b68 100644 --- a/generic/tkUtil.c +++ b/generic/tkUtil.c @@ -13,12 +13,8 @@ #include "tkInt.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif /* diff --git a/generic/ttk/ttkCache.c b/generic/ttk/ttkCache.c index 7b5ca01..f4d1846 100644 --- a/generic/ttk/ttkCache.c +++ b/generic/ttk/ttkCache.c @@ -31,12 +31,8 @@ #include "tkInt.h" #include "ttkTheme.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif struct Ttk_ResourceCache_ { diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index fe684a7..85ec1da 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -12,12 +12,8 @@ #include "ttkTheme.h" #include "ttkWidget.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif /* diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index e6267cf..717cbb5 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -8,12 +8,8 @@ #include "ttkTheme.h" #include "ttkWidget.h" -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif #define MAX(a,b) ((a) > (b) ? (a) : (b)) |