When building the latest in SVN on OSX using clang, there are a couple of minor compile errors. patch provided to fix them. (this allows the "core" stuff to compile)
Can you explain why the changes are needed? Or even post the build log?
According to wikipedia OSX is LP64 so it should be defined.
Are you building a 32bit app?
What version of wx are you using?
And why an empty destructor is needed?
C::B compiles fine on linux when using clang. What clang version are you using?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
64bit build on OSX. (no-one should be doing 32bit builts on OSX anymore) Built agains the latest wxWidgets from the 3.0.x branch (needed for fixes to various dialogs to allow it to run on Yosemite).
The empty destructor is needed for the "throw()". A couple of the fields have throws in their destructors so the destructor needs the throw() as well, I think.
Interesting. My versions of ~wxThread has nothing that mentions throwing in the declaration. I've checked 2.8, 3.0 and 3.1 on linux. And as far as I can see the header is common for all OSes. Can you check the declaration of the destructor in your version?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The destructor for the CountedPtr has a throw() on it. WorkerThread has a field of "CountedPtr<wxsemaphore> m_semaphore" and thus that destructor would be called during the destruction of the WorkerThread. That's where the throw would potentially be coming from.</wxsemaphore>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you search for sizeof(long) and sizeof(long long) you'll see that they are both 8 bytes. So they should be the same type... or it is the difference caused by the uint64_t definition?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
They are the same size, but different types. Code like:
unsigned long i = 0;
unsigned long *foo = &i;
unsigned long long *bar = foo;
results in the same error. "long" and "long long" are both sizeof(..) == 8, but are different types and thus cannot be converted without a cast. On osx, uint64_t is defined as:
typedefunsignedlonglonguint64_t;
and thus is not an "unsigned long" so the direct pointer assignment doesn't work.
That said, a simple cast like:
if(address.ToULong((unsignedlong*)&result,16))
may also work just as well and would likely work for all the LP64 platforms.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Actually, CountedPtr's destructor doesn't need the throws() on it as it doesn't throw anything. Removing that from the destructor allows things to compile as well and then WorkerThread doesn't need the empty destructor.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
One problem I'm worried about is the base of the number. I have no clue what the code does or where it is used, but here's a minimal example that shows a potential problem:
and then at least the results seem to be the same. I only played with the minimal example, I didn't try to compile the code and test it in a real worl scenario.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can you explain why the changes are needed? Or even post the build log?
According to wikipedia OSX is LP64 so it should be defined.
Are you building a 32bit app?
What version of wx are you using?
And why an empty destructor is needed?
C::B compiles fine on linux when using clang. What clang version are you using?
Attached a section of the build log.
64bit build on OSX. (no-one should be doing 32bit builts on OSX anymore) Built agains the latest wxWidgets from the 3.0.x branch (needed for fixes to various dialogs to allow it to run on Yosemite).
The empty destructor is needed for the "throw()". A couple of the fields have throws in their destructors so the destructor needs the throw() as well, I think.
FYI: this is the clang that is installed via the latest releases from XCode from the Mac AppStore.
Interesting. My versions of ~wxThread has nothing that mentions throwing in the declaration. I've checked 2.8, 3.0 and 3.1 on linux. And as far as I can see the header is common for all OSes. Can you check the declaration of the destructor in your version?
The destructor for the CountedPtr has a throw() on it. WorkerThread has a field of "CountedPtr<wxsemaphore> m_semaphore" and thus that destructor would be called during the destruction of the WorkerThread. That's where the throw would potentially be coming from.</wxsemaphore>
And I really doubt that you're building in 64 bit mode. See this discussion for details http://stackoverflow.com/questions/2383520/on-mac-os-x-in-c-on-a-64-bit-cpu-is-there-a-type-that-is-64-bits
If you search for sizeof(long) and sizeof(long long) you'll see that they are both 8 bytes. So they should be the same type... or it is the difference caused by the uint64_t definition?
They are the same size, but different types. Code like:
results in the same error. "long" and "long long" are both sizeof(..) == 8, but are different types and thus cannot be converted without a cast. On osx, uint64_t is defined as:
and thus is not an "unsigned long" so the direct pointer assignment doesn't work.
That said, a simple cast like:
may also work just as well and would likely work for all the LP64 platforms.
Actually, CountedPtr's destructor doesn't need the throws() on it as it doesn't throw anything. Removing that from the destructor allows things to compile as well and then WorkerThread doesn't need the empty destructor.
Simplified patch that just removes the throws() and uses a cast for LP64. Compiles fine on OSX.
Thanks, but I've redone the whole function using stringsteam. I'll post a patch later.
This is the patch:
Can you try it and report if it works?
Before I noticed this thread I came up with the following patch:
But I can test the solution with
istringstream
. Is there any particular test that I could run (other than just checking whether it compiles)?One problem I'm worried about is the base of the number. I have no clue what the code does or where it is used, but here's a minimal example that shows a potential problem:
The result is:
But I can use
and then at least the results seem to be the same. I only played with the minimal example, I didn't try to compile the code and test it in a real worl scenario.
Yeah, it seems to be an omission on my side. I'll test it more later today.
With the std::hex seems to work OK.
Fixed in trunk. If there are more issues please open new tickets.