-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Necessary changes were made in the aws-sdk-cpp to support AIX OS. #3714
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
Changes from 1 commit
a81ae51
5d24332
12ad207
146d08c
3744ba7
db3f899
14040d0
9ebfb4f
9b30c3c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,11 +153,6 @@ if (LEGACY_BUILD) | |
| endif () | ||
| endif () | ||
|
|
||
| # use response files to prevent command-line-too-big errors for large libraries like iam | ||
| set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1) | ||
| set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES 1) | ||
| set(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "@") | ||
|
|
||
| if (COMMAND apply_pre_project_platform_settings) | ||
| apply_pre_project_platform_settings() | ||
| endif () | ||
|
|
@@ -173,6 +168,13 @@ if (LEGACY_BUILD) | |
| # build the sdk targets | ||
| project("aws-cpp-sdk-all" VERSION "${PROJECT_VERSION}" LANGUAGES CXX) | ||
|
|
||
| if(NOT CMAKE_SYSTEM_NAME STREQUAL "AIX") | ||
| # use response files to prevent command-line-too-big errors for large libraries like iam | ||
| set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do these cmake flags need to be turned off for AIX?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CMake response file support is not enabled on AIX; therefore, it must be blocked. |
||
| set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES 1) | ||
| set(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "@") | ||
| endif() | ||
|
|
||
| find_package(Python3 COMPONENTS Interpreter Development) | ||
| set(PYTHON3_CMD ${PYTHON_EXECUTABLE}) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| /* TimeHelper.cpp | ||
|
sbiscigl marked this conversation as resolved.
Outdated
|
||
| timegm() implementation for AIX platform. | ||
| */ | ||
|
|
||
| #include <aws/core/platform/Time.h> | ||
|
|
||
| #include <time.h> | ||
|
|
||
| namespace Aws | ||
| { | ||
| namespace Time | ||
| { | ||
| time_t timegm (struct tm *tm) | ||
|
sbiscigl marked this conversation as resolved.
Outdated
|
||
| { | ||
| static const int msum [2][12] = { | ||
|
sbiscigl marked this conversation as resolved.
Outdated
|
||
| { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}, /* normal years */ | ||
| { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335} /* leap years */ | ||
| }; | ||
| static const int mlen [2][12] = { | ||
| { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, | ||
| { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} | ||
| }; | ||
| static const int tmstr_year= 1900; /* base of 'tm_year' in 'struct tm' */ | ||
| static const int epoch_year= 1970; /* unix timestamp epoch */ | ||
| static const int base_year= -9999; /* start of a 400-year period: used to be 1601, | ||
| but this allows larger range (in 64 bit) | ||
| mind you, this is proleptic Gregorian */ | ||
| int year, ytmp, dtmp, ytmpe, dtmpe; | ||
| int isleapyear; | ||
| long long t; | ||
|
|
||
| if (!tm) return -1; | ||
|
sbiscigl marked this conversation as resolved.
Outdated
|
||
|
|
||
| year = tm->tm_year + tmstr_year; | ||
| isleapyear= (year%4==0) - (year%100==0) + (year%400==0); | ||
|
|
||
| if (year<-9999 || year>9999 || | ||
| tm->tm_mon<0 || tm->tm_mon>11 || | ||
| tm->tm_mday<1 || tm->tm_mday>mlen[isleapyear][tm->tm_mon] || | ||
| tm->tm_hour<0 || tm->tm_hour>23 || | ||
| tm->tm_min<0 || tm->tm_min>59 || | ||
| tm->tm_min<0 || tm->tm_sec>59) return -1; | ||
|
sbiscigl marked this conversation as resolved.
Outdated
|
||
|
|
||
| /* days between 'current year' and 'epoch_year' has to be calculated | ||
| in three steps: */ | ||
|
|
||
| /* 1. days between current year and 'base_year' */ | ||
| ytmp = year - base_year; | ||
| dtmp = ytmp*365 + ytmp/4 - ytmp/100 + ytmp/400; | ||
|
|
||
| /* 2. days between 'epoch year' and 'base_year' */ | ||
| ytmpe = epoch_year - base_year; | ||
| dtmpe = ytmpe*365 + ytmpe/4 - ytmpe/100 + ytmpe/400; | ||
|
|
||
| /* 3. days between 'current year' and 'epoch_year' */ | ||
| t = dtmp - dtmpe; | ||
|
|
||
| t += msum[isleapyear][tm->tm_mon]; | ||
| t += tm->tm_mday-1; | ||
|
|
||
| tm->tm_wday = (t+4)%7;/* 0..6=Sun..Sat; adding 4 to adjust 1970.01.01.=Thursday; */ | ||
|
sbiscigl marked this conversation as resolved.
Outdated
|
||
| if (tm->tm_wday<0) tm->tm_wday += 7; | ||
| tm->tm_yday = msum[isleapyear][tm->tm_mon] + tm->tm_mday-1; | ||
| tm->tm_isdst= 0; | ||
|
|
||
| t = t*24 + tm->tm_hour; | ||
| t = t*60 + tm->tm_min; | ||
| t = t*60 + tm->tm_sec; | ||
|
|
||
| #if LONG_MAX == 2147483647L | ||
| if (t<LONG_MIN || t>LONG_MAX) { | ||
| t= -1; | ||
| } | ||
| #endif | ||
|
|
||
| return t; | ||
| } | ||
|
|
||
| } // namespace Time | ||
| } // namespace Aws | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,9 @@ | |
| #include <unistd.h> | ||
| #include <climits> | ||
| #endif | ||
| #ifdef _AIX | ||
| #define NAME_MAX 255 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is this define used for?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NAME_MAX is used in the same file at line 281.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. on line 281 NAME_MAX is used as #if defined(HAS_PATHCONF)
errno = 0;
long longNameLength = pathconf(".", _PC_NAME_MAX);
ASSERT_TRUE(longNameLength >= 0 || errno == 0);
if (longNameLength <= 0)
{
longNameLength = NAME_MAX;
}
#else
// Path compoments on Windows can't exceed 255(_MAX_FNAME) chars.
// To cover the Windows case where the path with length over 260(MAX_PATH) chars,
// set one path part to be 255 characters, so dir1/dir2/dir3/[longDirName] is over 260 chars.
long longNameLength = 255;
#endifso which one does AIX fall into? does it have
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AIX defines
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please let me know if any action is required from my side regarding these changes. |
||
| #endif | ||
|
|
||
| using namespace Aws; | ||
| using namespace Aws::Utils; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.