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

Missing definitions for MACOS #95

Open
URecke opened this issue Aug 27, 2019 · 4 comments
Open

Missing definitions for MACOS #95

URecke opened this issue Aug 27, 2019 · 4 comments

Comments

@URecke
Copy link

URecke commented Aug 27, 2019

64 bit is now the default on Mac. However Apple uses long long instead of long. To be compatible the following is suggested:

#elif defined(__APPLE__)
	#define POCO_PTR_IS_64_BIT 1
	typedef signed long long   IntPtr;
	typedef unsigned long long UIntPtr;
	typedef signed long long   Int64;
	typedef unsigned long long UInt64;

(used and tried to pass is_same and similar with std types like std::uint64_t on Mac)

@obiltschnig
Copy link
Member

OK, I understand the real issue now ;-) This would have to be fixed in the POCO C++ Libraries first. However, I remember having done that once before and it lead to some issues with other parts of Poco. IMO the best way would be to map Poco::Int64 to std::int64_t (etc.) on every platform. With the next version of Poco we're moving to C++11/14, so <cstdint> should be universally available.

@URecke
Copy link
Author

URecke commented Aug 28, 2019

Yes, that would be a good solution. Just to clarify even more: We observed side effects especially in templated code. e.g. Poco::Any results in different typed objects instantiated with std::int64_t and with Poco::Int64.

BTW to have the std types we use something similar like the following (missing clean namespace handling...)

`#pragma once

#if __cplusplus >= 199711L
#include
#elif ( defined(_MSC_VER) && _MSC_VER < 1600 )
// e.g. EC7 and others can use boost
#include <boost\cstdint.hpp>

// Coding guidelines prevents the use of "using"
// keyword in headers. However this is needed
// to solve for compiler and platform differences
using boost::int8_t;
using boost::int16_t;
using boost::int32_t;
using boost::int64_t;
using boost::uint8_t;
using boost::uint16_t;
using boost::uint32_t;
using boost::uint64_t;

#else
#include <stdint.h>
#endif`

This could help to have a solution even before c++ 11

@URecke
Copy link
Author

URecke commented Nov 21, 2019

Should we move this issue to Poco project?
Any news?

@obiltschnig
Copy link
Member

Yes, this should be moved to Poco project. With the next release we're going to require C++11/C++14, so should be universally available.

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

No branches or pull requests

2 participants