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

Linux Compilation Fails on 64bits system #10

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

Linux Compilation Fails on 64bits system #10

GoogleCodeExporter opened this issue May 21, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

Here's a patch to fix the compilation on a linux 64bits system. I've compared 
the 32 and 64 bits files produced and they have same size. Also, the dds image 
looks exactly the same. However, there are some bytes that differ but doesn't 
seem to be a major issue though.

Original issue reported on code.google.com by [email protected] on 3 Dec 2012 at 4:59

Attachments:

@GoogleCodeExporter
Copy link
Author

fix a small issue with the other patch..

Original comment by [email protected] on 3 Dec 2012 at 5:19

Attachments:

@GoogleCodeExporter
Copy link
Author

I ran into this compilation error too. I think the issue though is that uint32 
is defined as uint, which is unsigned int - so on a 64-bit platform it is 
64-bit, and the compiler gives an error since defining the same function with 
uint32 and uint64 is actually the same thing. Using uint32_t might be better. 
But, just commenting out the uint32 versions of is_power_of_2 and next_pow2 
gets it to build on linux64.

Original comment by [email protected] on 12 Dec 2012 at 7:30

@GoogleCodeExporter
Copy link
Author

For the record, attached a modified patch with a minor change.

Original comment by [email protected] on 9 Jan 2013 at 5:15

Attachments:

@GoogleCodeExporter
Copy link
Author

Here's my fix for this. I chose the template route because that'll retain 
better behaviour on i386; and my patch also fixes some other compilation 
errors, the fixes being to prefix with “this->”.

I do agree that using <stdint.h> (uint32_t etc.) is preferred, though; indeed, 
I've used this in one place – casting between integers and pointers isn't 
valid, but we can go via intptr_t. (Make no assumptions about pointer sizes – 
the Linux x32 architecture is 32-bit long and 32-bit pointer, but otherwise 
amd64.)

Original comment by [email protected] on 25 Jan 2013 at 3:58

Attachments:

@GoogleCodeExporter
Copy link
Author

this patches fail when applyed:

alejandro@desktop:~/crunch-read-only/crnlib$ patch < linux_64_compilation.patch 
patching file crn_math.h
Hunk #1 FAILED at 56.
Hunk #2 FAILED at 79.
Hunk #3 FAILED at 91.
3 out of 3 hunks FAILED -- saving rejects to file crn_math.h.rej
patching file crnlib.cpp
Hunk #1 FAILED at 52.
Hunk #2 FAILED at 456.
2 out of 2 hunks FAILED -- saving rejects to file crnlib.cpp.rej
patching file crn_decomp.h
Hunk #1 FAILED at 374.
1 out of 1 hunk FAILED -- saving rejects to file crn_decomp.h.rej

Original comment by [email protected] on 27 Feb 2013 at 12:43

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