Tk Source Code

View Ticket
Login
Ticket UUID: 5c5140f23d7bd40160c4dcc5c11e29cf38df5135
Title: inline is declared as a macro this prevents building tk8.6.7 in visual studio 2017
Type: Bug Version: 8.6.7
Submitter: InterestedTom Created on: 2017-10-23 10:52:21
Subsystem: 85. Win Build Assigned To: nobody
Priority: 1 Zero Severity: Important
Status: Closed Last Modified: 2017-10-23 11:34:04
Resolution: Accepted Closed By: InterestedTom
    Closed on: 2017-10-23 11:34:04
Description:
C:\Users\tompd\OneDrive\Salome\tk867-src\tk8.6.7\win>nmake -f makefile.vc INSTALLDIR=C:\tk8.6.7 TCLDIR=C:\Users\tompd\OneDrive\Salome\tcl867-src\tcl8.6.7\

Microsoft (R) Program Maintenance Utility Version 14.11.25547.0
Copyright (C) Microsoft Corporation.  All rights reserved.

===============================================================================
*** Compiler has 'Optimizations'
*** Intermediate directory will be '.\Release_AMD64_VC13\tk_ThreadedDynamic'
*** Output directory will be '.\Release_AMD64_VC13'
*** Suffix for binaries will be 't'
*** Optional defines are '-DTCL_CFGVAL_ENCODING=\"cp1252\" -DSTDC_HEADERS -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -DNDEBUG -DTCL_CFG_OPTIMIZED -DTCL_CFG_DO64BIT'
*** Compiler version 13. Target machine is AMD64
*** Host architecture is AMD64
*** Compiler options '-W3 /DUNICODE /D_UNICODE /D_ATL_XP_TARGETING  -Ot -Oi -fp:strict -Gs -GS -GL  -RTC1 -W3'
*** Link options '-ltcg'
*** Dependency rules are not being used.

        cl -nologo -c -W3 /DUNICODE /D_UNICODE /D_ATL_XP_TARGETING -W3 -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE -Fp.\Release_AMD64_VC13\tk_ThreadedDynamic\  -Ot -Oi -fp:strict -Gs -GS -GL -DBUILD_ttk -DTCL_CFGVAL_ENCODING=\"cp1252\" -DSTDC_HEADERS -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -DNDEBUG -DTCL_CFG_OPTIMIZED -DTCL_CFG_DO64BIT  -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1  -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1  -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1  -DSUPPORT_CONFIG_EMBEDDED  -DHAVE_UXTHEME_H=1 -Dinline=__inline -I"C:\Users\tompd\OneDrive\Salome\tk867-src\tk8.6.7\win\..\win" -I"C:\Users\tompd\OneDrive\Salome\tk867-src\tk8.6.7\win\..\generic" -I"C:\Users\tompd\OneDrive\Salome\tk867-src\tk8.6.7\win\..\bitmaps" -I"C:\Users\tompd\OneDrive\Salome\tk867-src\tk8.6.7\win\..\xlib"  -I"C:\Users\tompd\OneDrive\Salome\tcl867-src\tcl8.6.7\\generic" -I"C:\Users\tompd\OneDrive\Salome\tcl867-src\tcl8.6.7\\win" -Zl -DSTATIC_BUILD -Fo.\Release_AMD64_VC13\tk_ThreadedDynamic\tkStubLib.obj C:\Users\tompd\OneDrive\Salome\tk867-src\tk8.6.7\win\..\generic\tkStubLib.c
tkStubLib.c
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\xkeycheck.h(65): warning C4005: 'inline': macro redefinition
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\xkeycheck.h(65): note: command-line arguments:  see previous definition of 'inline'
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\xkeycheck.h(87): fatal error C1189: #error:  The C Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\cl.EXE"' : return code '0x2'
Stop.

C:\Users\tompd\OneDrive\Salome\tk867-src\tk8.6.7\win>


It appears that tk declares the keyword inline as a macro somewhere in one of the headers, I have tried to find it but haven't managed to yet, hopefully someone better acquainted with the source code will no where to look.

This is should be an easy fix but prevents building with nmake on windows
User Comments: InterestedTom added on 2017-10-23 11:34:04:
turns out the problem only arises if you try to fix another problem the wrong way.

InterestedTom added on 2017-10-23 11:08:22:
makefile.vc line 435 includes a definition of inline, shouldn't be done