Skip to content

Commit

Permalink
Merge pull request MatthewYork#89 from MaciejWalczynski/swift_constan…
Browse files Browse the repository at this point in the history
…ts_support

fix for linker error in a swift project
  • Loading branch information
MatthewYork committed Jul 28, 2015
2 parents a381ec0 + a141286 commit 34f3cb4
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 10 deletions.
20 changes: 10 additions & 10 deletions DateTools/DTConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@

#import <Foundation/Foundation.h>

static const long long SECONDS_IN_YEAR = 31556900;
static const NSInteger SECONDS_IN_MONTH_28 = 2419200;
static const NSInteger SECONDS_IN_MONTH_29 = 2505600;
static const NSInteger SECONDS_IN_MONTH_30 = 2592000;
static const NSInteger SECONDS_IN_MONTH_31 = 2678400;
static const NSInteger SECONDS_IN_WEEK = 604800;
static const NSInteger SECONDS_IN_DAY = 86400;
static const NSInteger SECONDS_IN_HOUR = 3600;
static const NSInteger SECONDS_IN_MINUTE = 60;
static const NSInteger MILLISECONDS_IN_DAY = 86400000;
FOUNDATION_EXPORT const long long SECONDS_IN_YEAR;
FOUNDATION_EXPORT const NSInteger SECONDS_IN_MONTH_28;
FOUNDATION_EXPORT const NSInteger SECONDS_IN_MONTH_29;
FOUNDATION_EXPORT const NSInteger SECONDS_IN_MONTH_30;
FOUNDATION_EXPORT const NSInteger SECONDS_IN_MONTH_31;
FOUNDATION_EXPORT const NSInteger SECONDS_IN_WEEK;
FOUNDATION_EXPORT const NSInteger SECONDS_IN_DAY;
FOUNDATION_EXPORT const NSInteger SECONDS_IN_HOUR;
FOUNDATION_EXPORT const NSInteger SECONDS_IN_MINUTE;
FOUNDATION_EXPORT const NSInteger MILLISECONDS_IN_DAY;
#import "DTError.h"
33 changes: 33 additions & 0 deletions DateTools/DTConstants.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright (C) 2014 by Matthew York
//
// Permission is hereby granted, free of charge, to any
// person obtaining a copy of this software and
// associated documentation files (the "Software"), to
// deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the
// Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall
// be included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#import "DTConstants.h"
const long long SECONDS_IN_YEAR = 31556900;
const NSInteger SECONDS_IN_MONTH_28 = 2419200;
const NSInteger SECONDS_IN_MONTH_29 = 2505600;
const NSInteger SECONDS_IN_MONTH_30 = 2592000;
const NSInteger SECONDS_IN_MONTH_31 = 2678400;
const NSInteger SECONDS_IN_WEEK = 604800;
const NSInteger SECONDS_IN_DAY = 86400;
const NSInteger SECONDS_IN_HOUR = 3600;
const NSInteger SECONDS_IN_MINUTE = 60;
const NSInteger MILLISECONDS_IN_DAY = 86400000;
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/* Begin PBXBuildFile section */
0AFD486518F0BBC0004D0FE1 /* DateTools.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 0AFD486418F0BBC0004D0FE1 /* DateTools.bundle */; };
D935DB441B567FBD00BAA4F0 /* DTConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = D935DB431B567FBD00BAA4F0 /* DTConstants.m */; };
F007632018DE5F5E00A99075 /* DateToolsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F007631E18DE5F5E00A99075 /* DateToolsViewController.m */; };
F007632118DE5F5E00A99075 /* DateToolsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F007631F18DE5F5E00A99075 /* DateToolsViewController.xib */; };
F007632518DE5FE300A99075 /* Colours.m in Sources */ = {isa = PBXBuildFile; fileRef = F007632418DE5FE300A99075 /* Colours.m */; };
Expand Down Expand Up @@ -56,6 +57,7 @@

/* Begin PBXFileReference section */
0AFD486418F0BBC0004D0FE1 /* DateTools.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = DateTools.bundle; path = ../../../DateTools/DateTools.bundle; sourceTree = "<group>"; };
D935DB431B567FBD00BAA4F0 /* DTConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DTConstants.m; path = ../../../DateTools/DTConstants.m; sourceTree = "<group>"; };
F007631D18DE5F5E00A99075 /* DateToolsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateToolsViewController.h; sourceTree = "<group>"; };
F007631E18DE5F5E00A99075 /* DateToolsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DateToolsViewController.m; sourceTree = "<group>"; };
F007631F18DE5F5E00A99075 /* DateToolsViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DateToolsViewController.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -273,6 +275,7 @@
F0EE17E218DEB1A10010FAD8 /* DTError.m */,
F0EE17E018DEAE190010FAD8 /* DateTools.h */,
F0A426D918DA358C00E236C0 /* DTConstants.h */,
D935DB431B567FBD00BAA4F0 /* DTConstants.m */,
F0F08DD718D9E94F00214C6B /* NSDate+DateTools.h */,
F0F08DD818D9E94F00214C6B /* NSDate+DateTools.m */,
F0A426D418D9FDB500E236C0 /* DTTimePeriod.h */,
Expand Down Expand Up @@ -393,6 +396,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D935DB441B567FBD00BAA4F0 /* DTConstants.m in Sources */,
F0EE17E718DEB1A10010FAD8 /* DTError.m in Sources */,
F0EE17EB18DEB1A10010FAD8 /* DTTimePeriodGroup.m in Sources */,
F0A426D618D9FDB500E236C0 /* DTTimePeriod.m in Sources */,
Expand Down

0 comments on commit 34f3cb4

Please sign in to comment.