Login Page - Create Account

Support Board


Date/Time: Sun, 08 Sep 2024 00:41:52 +0000



ASCIL error in scdatetime.h: undeclared identifier _ASSERT

View Count: 108

[2024-07-13 16:29:32]
emmanuel - Posts: 57
With the recent ASCIL update which changed the SC_DLL_VERSION from 2644 to 2656, an error was introduced in scdatetime.h:

diff --git a/scdatetime.h b/scdatetime.h
index 5f462c3..a27e960 100644
--- a/scdatetime.h
+++ b/scdatetime.h
@@ -357,11 +357,13 @@ DEPRECATED("The DAY_OF_WEEK is deprecated. Use SCDateTime::GetDayOfWeek() instea
inline DayOfWeekEnum DAY_OF_WEEK(int Date)
{
  Date -= 1;
-  // Special handling for zero and negative values.
+  Date %= DAYS_PER_WEEK;
  if (Date < 0)
-    Date = Date % DAYS_PER_WEEK + DAYS_PER_WEEK;
+    Date += DAYS_PER_WEEK;

-  return static_cast<DayOfWeekEnum>(Date % DAYS_PER_WEEK);
+  _ASSERT(Date >= 0 && Date < DAYS_PER_WEEK && "Out of boundary of Day of week");
+
+  return static_cast<DayOfWeekEnum>(Date);
}

/*==========================================================================*/
@@ -376,10 +378,13 @@ DEPRECATED("The DAY_OF_WEEK_MONDAY_BASED is deprecated. Use SCDateTime::GetDayOf
inline DayOfWeekMondayBasedEnum DAY_OF_WEEK_MONDAY_BASED(int Date)
{
  Date -= 2;
+  Date %= DAYS_PER_WEEK;
  if (Date < 0)
-    Date = DAYS_PER_WEEK + Date % DAYS_PER_WEEK ;
+    Date += DAYS_PER_WEEK;
+
+  _ASSERT(Date >= 0 && Date < DAYS_PER_WEEK && "Out of boundary of Day of week");

-  return static_cast<DayOfWeekMondayBasedEnum>(Date % DAYS_PER_WEEK);
+  return static_cast<DayOfWeekMondayBasedEnum>(Date);
}
/*==========================================================================*/
inline const char* GetFullNameForMonth(int Month)

This causes a build failure with Clang:

In file included from /tmp/0b61ed0c83eea9e99ef1ed449a72a83123535a9150fb3de127e7213d75ca7a57.mkwindowsapp/wineprefix/drive_c/SierraChart/ACS_Source/ErosaStudies.cpp:1:
In file included from /tmp/0b61ed0c83eea9e99ef1ed449a72a83123535a9150fb3de127e7213d75ca7a57.mkwindowsapp/wineprefix/drive_c/SierraChart/ACS_Source/sierrachart.h:22:
In file included from /tmp/0b61ed0c83eea9e99ef1ed449a72a83123535a9150fb3de127e7213d75ca7a57.mkwindowsapp/wineprefix/drive_c/SierraChart/ACS_Source/scstructures.h:105:
/tmp/0b61ed0c83eea9e99ef1ed449a72a83123535a9150fb3de127e7213d75ca7a57.mkwindowsapp/wineprefix/drive_c/SierraChart/ACS_Source/scdatetime.h:364:2: error: use of undeclared identifier '_ASSERT'
364 | _ASSERT(Date >= 0 && Date < DAYS_PER_WEEK && "Out of boundary of Day of week");
| ^
/tmp/0b61ed0c83eea9e99ef1ed449a72a83123535a9150fb3de127e7213d75ca7a57.mkwindowsapp/wineprefix/drive_c/SierraChart/ACS_Source/scdatetime.h:385:2: error: use of undeclared identifier '_ASSERT'
385 | _ASSERT(Date >= 0 && Date < DAYS_PER_WEEK && "Out of boundary of Day of week");
| ^

I also tried compiling with a remote build (Mingw/GCC) and it also failed:


-- Starting remote build of Custom Studies Source files: ErosaStudies.cpp scext.h. 64-bit -- 16:24:24

Allow time for the server to compile the files and build the DLL.

Server: https://build2.sierrachart.com
The remote build is complete.
The build failed.
In file included from scstructures.h:105,
from sierrachart.h:22,
from ErosaStudies.cpp:1:
scdatetime.h: In function 'DayOfWeekEnum DAY_OF_WEEK(int)':
scdatetime.h:364:2: error: '_ASSERT' was not declared in this scope; did you mean 'C_ASSERT'?
364 | _ASSERT(Date >= 0 && Date < DAYS_PER_WEEK && "Out of boundary of Day of week");
| ^~~~~~~
| C_ASSERT
scdatetime.h: In function 'DayOfWeekMondayBasedEnum DAY_OF_WEEK_MONDAY_BASED(int)':
scdatetime.h:385:2: error: '_ASSERT' was not declared in this scope; did you mean 'C_ASSERT'?
385 | _ASSERT(Date >= 0 && Date < DAYS_PER_WEEK && "Out of boundary of Day of week");
| ^~~~~~~
| C_ASSERT

[2024-07-13 18:39:28]
Sierra_Chart Engineering - Posts: 16292
We are checking on this.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account