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

Add support for building on SunOS with gcc #1154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/soci/exchange-traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@ struct exchange_traits
};
};

#if SOCI_OS != SOCI_OS_SUN
// As in SunOS: typedef char int8_t;
Comment on lines +47 to +48
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's a property of Solaris per se, we should almost certainly check whether char and int8_t are the same in CMake and define some SOCI_HAVE_INT8_T_TYPEDEF or something like this and test for it here.

template <>
struct exchange_traits<int8_t>
{
typedef basic_type_tag type_family;
enum { x_type = x_int8 };
};
#endif

template <>
struct exchange_traits<uint8_t>
Expand Down
3 changes: 3 additions & 0 deletions include/soci/soci-platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ private: \
#define SOCI_OS_FREE_BSD 0x0002
#define SOCI_OS_APPLE 0x0003
#define SOCI_OS_WINDOWS 0x0004
#define SOCI_OS_SUN 0x0005

#if defined(linux) || defined(__linux) || defined(__linux__)
#define SOCI_OS SOCI_OS_LINUX
Expand All @@ -188,6 +189,8 @@ private: \
#define SOCI_OS SOCI_OS_APPLE
#elif defined(_WIN32) || defined(_WIN64)
#define SOCI_OS SOCI_OS_WINDOWS
#elif defined(sun) || defined(__sun) || defined(__sun__)
#define SOCI_OS SOCI_OS_SUN
#endif

#if !defined(SOCI_OS)
Expand Down
2 changes: 1 addition & 1 deletion include/soci/soci-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#if defined(__GNUC__) || defined(__clang__)
#if defined(__LP64__)
#define SOCI_LONG_IS_64_BIT 1
#if SOCI_OS == SOCI_OS_LINUX || SOCI_OS == SOCI_OS_FREE_BSD
#if SOCI_OS == SOCI_OS_LINUX || SOCI_OS == SOCI_OS_FREE_BSD || SOCI_OS == SOCI_OS_SUN
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too we should just check for the condition directly instead of testing for the platform... In fact, I really don't know why did we do it like this in the first place, @zann1x do you remember if there was some good reason for it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there was any other reason for it than to just make it work both locally and in the CI pipeline. In the end, it's only important that we know which data type definitions the underlying OS uses.

#define SOCI_INT64_IS_LONG 1
#endif
#endif
Expand Down
Loading