Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need stddef.h for offsetof #22

Open
GoogleCodeExporter opened this issue Dec 21, 2015 · 5 comments
Open

Need stddef.h for offsetof #22

GoogleCodeExporter opened this issue Dec 21, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 4 May 2011 at 2:36

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 14 Oct 2011 at 3:21

Attachments:

@GoogleCodeExporter
Copy link
Author

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

Original comment by [email protected] on 22 Oct 2011 at 6:43

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 17 Jan 2013 at 4:17

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 27 May 2013 at 6:40

@GoogleCodeExporter
Copy link
Author

Another solution: http://code.google.com/p/ttf2eot/issues/detail?id=29

Original comment by [email protected] on 16 Jan 2014 at 3:45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant