codename065 / ttf2eot

Automatically exported from code.google.com/p/ttf2eot
0 stars 0 forks source link

Need stddef.h for offsetof #22

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. try to build using gcc 4.6

What is the expected output? What do you see instead?
Here is a failed build.
% make
g++    -c -o OpenTypeUtilities.o OpenTypeUtilities.cpp
OpenTypeUtilities.cpp:227:18: warning: multi-character character constant 
[-Wmultichar]
OpenTypeUtilities.cpp:247:18: warning: multi-character character constant 
[-Wmultichar]
OpenTypeUtilities.cpp:257:18: warning: multi-character character constant 
[-Wmultichar]
OpenTypeUtilities.cpp: In function ‘bool getEOTHeader(unsigned char*, size_t, 
std::vector<unsigned char>&, size_t&, size_t&, size_t&)’:
OpenTypeUtilities.cpp:197:41: error: expected primary-expression before ‘,’ 
token
OpenTypeUtilities.cpp:197:43: error: ‘tables’ was not declared in this scope
OpenTypeUtilities.cpp:197:49: error: ‘offsetof’ was not declared in this 
scope
OpenTypeUtilities.cpp:202:41: error: expected primary-expression before ‘,’ 
token
OpenTypeUtilities.cpp:202:43: error: ‘tables’ was not declared in this scope
OpenTypeUtilities.cpp:202:49: error: ‘offsetof’ was not declared in this 
scope
OpenTypeUtilities.cpp:259:70: error: expected primary-expression before ‘,’ 
token
OpenTypeUtilities.cpp:259:72: error: ‘nameRecords’ was not declared in this 
scope
OpenTypeUtilities.cpp:259:83: error: ‘offsetof’ was not declared in this 
scope
OpenTypeUtilities.cpp:265:74: error: expected primary-expression before ‘,’ 
token
OpenTypeUtilities.cpp:265:76: error: ‘nameRecords’ was not declared in this 
scope
OpenTypeUtilities.cpp:265:87: error: ‘offsetof’ was not declared in this 
scope
make: *** [OpenTypeUtilities.o] Error 1

What version of the product are you using? On what operating system?
ttf2eot-0.0.2-2
Ubuntu 10.10
gcc 4.6.0

Please provide any additional information below.
To fix #include <stddef.h> explicitly in OpenTypeUtilities.cpp.

Original issue reported on code.google.com by kgsm...@gmail.com on 4 May 2011 at 2:36

GoogleCodeExporter commented 9 years ago
I patched it, including "cstddef" (the project is in C++). The patch is 
attached, tested on ArchLinux, gcc version 4.6.1 20110819 (prerelease) (GCC).

Original comment by andrea.g...@gmail.com on 14 Oct 2011 at 3:21

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you very much for the patch, works for me on gcc 4.6.1-9ubuntu3 on Ubuntu 
11.10 too.

Original comment by srik....@gmail.com on 22 Oct 2011 at 6:43

GoogleCodeExporter commented 9 years ago
This patched worked for me on Ubuntu 12.04.1 LTS / gcc version 4.6.3 
(Ubuntu/Linaro 4.6.3-1ubuntu5)  as well.

Thanks!

Original comment by matt.far...@gmail.com on 17 Jan 2013 at 4:17

GoogleCodeExporter commented 9 years ago
Thanks, both including stddef.h and cstddef worked perfectly on Debian 7 GCC 
4.7.2. 

Does anybody know of any incompatibility where including these would cause any 
harm?

As OpenTypeUtilities.cpp anyway seems to be "Modified for use with ttf2eot" I 
would otherwise suggest to include this patch in a ttf2eot 0.0.3 or similar. 

Original comment by jochen.s...@gmail.com on 27 May 2013 at 6:40

GoogleCodeExporter commented 9 years ago
Another solution: http://code.google.com/p/ttf2eot/issues/detail?id=29

Original comment by feniksgo...@gmail.com on 16 Jan 2014 at 3:45