Skip to content

Commit

Permalink
remove unnecessary guards
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Downs <[email protected]>
  • Loading branch information
briandowns committed Oct 5, 2024
1 parent 1058672 commit 855e9b2
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/optionals/datetime.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// Assumes length of BUF is 26
#define asctime_r(TIME_PTR, BUF) (asctime_s(BUF, 26, TIME_PTR), BUF)
#define gmtime_r(TIMER, BUF) gmtime_s(BUF, TIMER)
#else
#define HAS_STRPTIME
#endif

#define ISO8601Format "%m/%d/%Y %H:%M:%S %Z"
Expand Down Expand Up @@ -184,7 +182,6 @@ static Value datetimeToString(DictuVM *vm, int argCount, Value *args) {
return OBJ_VAL(takeString(vm, point, length));
}

#ifdef HAS_STRPTIME
static Value datetimeUnix(DictuVM *vm, int argCount, Value *args) {
if (argCount != 0) {
runtimeError(vm, "unix() takes 0 arguments (%d given)", argCount);
Expand All @@ -195,7 +192,6 @@ static Value datetimeUnix(DictuVM *vm, int argCount, Value *args) {

return NUMBER_VAL(datetime->time);
}
#endif

ObjAbstract *newDatetimeObj(DictuVM *vm, long time, int isLocal) {
ObjAbstract *abstract = newAbstract(vm, freeDatetime, datetimeTypeToString);
Expand All @@ -208,10 +204,7 @@ ObjAbstract *newDatetimeObj(DictuVM *vm, long time, int isLocal) {
/**
* Setup Datetime object methods
*/
#ifdef HAS_STRPTIME
defineNative(vm, &abstract->values, "unix", datetimeUnix);
#endif

defineNative(vm, &abstract->values, "utc", datetimeUTC);
defineNative(vm, &abstract->values, "before", datetimeBefore);
defineNative(vm, &abstract->values, "after", datetimeAfter);
Expand Down Expand Up @@ -430,8 +423,6 @@ static Value datetimeTimezone(DictuVM *vm, int argCount, Value *args) {
}

static Value newDatetimeNative(DictuVM *vm, int argCount, Value *args) {
UNUSED(args);

if (argCount > 1 || argCount < 0) {
runtimeError(vm, "new() takes 0 or 1 arguments (%d given)", argCount);
return EMPTY_VAL;
Expand Down

0 comments on commit 855e9b2

Please sign in to comment.