mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
MSVC compatiblity: Array initialization in MSVC requires a constant, not a variable.
That is, gcc accepts a constant variable in many cases now, but MSVC doesn't accept it. So it must be turned into an old preprocessor define. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18750 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -363,10 +363,12 @@ xml_destroy_backend(QofBackend *be)
|
||||
"file.YYYYMMDDHHMMSS.xac" where YYYYMMDDHHMMSS is replaced with the
|
||||
current year/month/day/hour/minute/second. */
|
||||
|
||||
/* The variable buf_size must be a compile-time constant */
|
||||
#define buf_size 1024
|
||||
|
||||
static gboolean
|
||||
copy_file(const char *orig, const char *bkup)
|
||||
{
|
||||
static int buf_size = 1024;
|
||||
char buf[buf_size];
|
||||
int orig_fd;
|
||||
int bkup_fd;
|
||||
|
||||
@@ -555,13 +555,14 @@ _weekly_list_to_compact_string(GList *rs, GString *buf)
|
||||
}
|
||||
}
|
||||
|
||||
/* A constant is needed for the array size */
|
||||
#define abbrev_day_name_bufsize 10
|
||||
static void
|
||||
_monthly_append_when(Recurrence *r, GString *buf)
|
||||
{
|
||||
GDate date = recurrenceGetDate(r);
|
||||
if (recurrenceGetPeriodType(r) == PERIOD_LAST_WEEKDAY)
|
||||
{
|
||||
gint abbrev_day_name_bufsize = 10;
|
||||
gchar day_name_buf[abbrev_day_name_bufsize];
|
||||
|
||||
gnc_dow_abbrev(day_name_buf, abbrev_day_name_bufsize, g_date_get_weekday(&date) % 7);
|
||||
|
||||
Reference in New Issue
Block a user