>If I got it right, you are trying to fix a rather informative compiler warning
>for a specific compiler by not defining some symbols,
>
Not exactly. The Windows Resource Compiler processes .RC resource files and not
C/C++ files (but uses a C pre-processor). The code in
podofo\src\doc\podofo-doc.rc looks like this
#define VER_PRODUCTVERSION PODOFO_MAJOR,PODOFO_MINOR,PODOFO_REVISION,20
#define VER_PRODUCTVERSION_STR PODOFO_VERSION_STRING
#define VER_FILEVERSION VER_PRODUCTVERSION
#define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
PRODUCTVERSION VER_PRODUCTVERSION
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS (VS_FF_PRIVATEBUILD|VER_PRERELEASE|VER_DEBUG)
FILEOS VOS__WINDOWS32
FILETYPE VER_FILETYPE
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileVersion", VER_FILEVERSION
VALUE "ProductVersion", VER_PRODUCTVERSION
VALUE "Comments", "PoDoFo Doc PDF Library\0"
VALUE "CompanyName", "PoDoFo\0"
VALUE "InternalName", "podofo\0"
VALUE "ProductName", "PoDoFo\0"
VALUE "LegalCopyright", "Copyright (C) 2010 Dominik Seichter, Craig
Ringer, The PoDoFo Developers\0"
VALUE "FileDescription", VER_FILEDESCRIPTION_STR
VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR
VALUE "PrivateBuild", VER_PRIVATEBUILD_STR
END
END
END
The symbol in question is PODOFO_COMPILER_LACKS_LL_LITERAL which is only used
by the C++ code to decide the type of C++ literals the C++ compiler supports.
The Resource Compiler doesn't support C++ LL literals (or C++ code) and
podofo-doc.rc doesn't use the PODOFO_COMPILER_LACKS_LL_LITERAL macro, but warns
that the macro is too long (so the warning isn't useful)
The only macros podofo-doc.rc uses are the ones that define the PoDoFo version,
which get included in the version resource above.
The reason I chose __FILE__ was
__FILE__ was documented in "The C Programming Language" by Kernighan and Richie
in 1988 so it's supported by very old compilers
__FILE__ is guaranteed to be defined in C/C++ code by the C/C++ standard (first
standardised in C89)
__FILE__ is documented as undefined in the Windows Resource Compiler
documentation
PoDoFo C++ code won't compile if __FILE__ is undefined since it's used by
PODOFO_RAISE_ERROR (and several other places)
Best Regards
Mark
Mark Rogers - [email protected]
PowerMapper Software Ltd - www.powermapper.com
Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL
-----Original Message-----
From: zyx [mailto:[email protected]]
Sent: 08 May 2016 17:59
To: [email protected]
Subject: Re: [Podofo-users] Patch for warning RC4011: identifier truncated to
'PODOFO_COMPILER_LACKS_LL_LITERA'
On Thu, 2016-05-05 at 10:56 -0500, Mark Rogers wrote:
> The following patch removes the long standing Resource Compiler
> warning in Windows builds:
Hi,
thanks for the code snippet (not a patch, it looks slightly differently). :)
> PdfCompilerCompat.h(110) : warning RC4011: identifier truncated to
> 'PODOFO_COMPILER_LACKS_LL_LITERA'
If I got it right, you are trying to fix a rather informative compiler warning
for a specific compiler by not defining some symbols, which are used in the
code in a various places, by checking some probably defined symbol in all
(most) other compilers which can be used to compile the sources.
I do not think it's a way to go.
You should check for that particular compiler version, if you want to avoid the
warning for it (see the top of the PdfCompilerCompat.h).
You shouldn't do that by not defining something which is used in the code (I
know, rc.exe is used for the resource compiling only, but anyway). When the
symbol (__FILE__) is not defined in the code-compiler too, then the code might
not build.
There is a PODOFO_COMPILE_RC, which seems suitable for the issue you are trying
to address.
Bye,
zyx
--
http://www.litePDF.cz [email protected]
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users