Sorry, you can ignore this patch (it was against the 0.9.3 sources we use)

I just pulled the latest source from SVN and the resource compiler warning no 
longer appears in trunk (so patch not needed)

PS I did notice one build problem that might affect some users. The include 
wrapper podofo/podofo/PdfExtension.h is missing from SVN (running 
create_forward_headers.sh should fix this)

Best Regards
Mark

Mark Rogers - mark.rog...@powermapper.com
PowerMapper Software Ltd - www.powermapper.com 
Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL 


-----Original Message-----
From: Mark Rogers [mailto:mark.rog...@powermapper.com] 
Sent: 09 May 2016 13:56
To: zyx; podofo-users@lists.sourceforge.net
Subject: Re: [Podofo-users] Patch for 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,
>
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 - mark.rog...@powermapper.com PowerMapper Software Ltd - 
www.powermapper.com Registered in Scotland No 362274 Quartermile 2 Edinburgh 
EH3 9GL 

-----Original Message-----
From: zyx [mailto:z...@litepdf.cz]
Sent: 08 May 2016 17:59
To: podofo-users@lists.sourceforge.net
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                                 i...@litepdf.cz

------------------------------------------------------------------------------
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
Podofo-users@lists.sourceforge.net
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
Podofo-users@lists.sourceforge.net
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
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to