Add NS_ENUM and NS_OPTIONS

This commit is contained in:
Robert Grant 2014-02-13 14:55:24 -08:00
parent 7d5138cadf
commit b00ecddc60
2 changed files with 15 additions and 4 deletions

View File

@ -89,6 +89,14 @@ typedef NSInteger NSComparisonResult;
#warning ABS is already defined, ABS(a) may not behave as expected.
#endif
#ifndef NS_ENUM
#define NS_ENUM(_type, _name) _type _name; enum
#endif
#ifndef NS_OPTIONS
#define NS_OPTIONS(_type, _name) _type _name; enum
#endif
FOUNDATION_EXPORT void NSLog(NSString *format,...);
FOUNDATION_EXPORT void NSLogv(NSString *format,va_list args);

View File

@ -22,6 +22,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <Foundation/NSPlatform_win32.h>
#import <Foundation/NSString_win32.h>
#include <sys/stat.h>
#include <windows.h>
#include <shlobj.h>
#include <objbase.h>
@ -686,7 +687,9 @@ static BOOL _NSCreateDirectory(NSString *path,NSError **errorp)
if(path == nil) {
return NO;
}
#if 0
DWORD attributes=GetFileAttributesW([path fileSystemRepresentationW]);
if(attributes==0xFFFFFFFF)
@ -696,12 +699,12 @@ static BOOL _NSCreateDirectory(NSString *path,NSError **errorp)
*isDirectory=(attributes&FILE_ATTRIBUTE_DIRECTORY)?YES:NO;
return YES;
#if 0
struct stat buf;
#else
struct _stat buf;
*isDirectory=NO;
if(stat([path fileSystemRepresentationW],&buf)<0)
if(_wstat([path fileSystemRepresentationW],&buf)<0)
return NO;
if((buf.st_mode&S_IFMT)==S_IFDIR)