2 * Copyright 2001-2004 Brandon Long
5 * ClearSilver Templating System
7 * This code is made available under the terms of the ClearSilver License.
8 * http://www.clearsilver.net/license.hdf
12 #ifndef incl_HPHP_NEO_MISC_H_
13 #define incl_HPHP_NEO_MISC_H_ 1
19 /* In case they didn't start from ClearSilver.h. */
20 #ifndef incl_HPHP_CS_CONFIG_H_
21 #include "hphp/neo/cs_config.h"
24 /* Fix Up for systems that don't define these standard things */
27 #define __BEGIN_DECLS extern "C" {
35 #define PATH_BUF_SIZE 512
40 #define S_IWUSR _S_IWRITE
41 #define S_IRUSR _S_IREAD
45 #define S_IXGRP S_IXUSR
48 #define S_IWGRP S_IWUSR
51 #define S_IRGRP S_IRUSR
54 #define S_IXOTH S_IXUSR
57 #define S_IWOTH S_IWUSR
60 #define S_IROTH S_IRUSR
63 /* Format string checking for compilers that support it (GCC style) */
65 #ifndef ATTRIBUTE_PRINTF
66 #if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ > 6
67 #define ATTRIBUTE_PRINTF(a1,a2) __attribute__((__format__ (__printf__, a1, a2)))
69 #define ATTRIBUTE_PRINTF(a1,a2)
77 #include <sys/types.h>
79 typedef unsigned int UINT32
;
80 typedef unsigned short int UINT16
;
81 typedef short int INT16
;
82 typedef unsigned char UINT8
;
83 /* This was conflicting with a cygwin header definition */
85 typedef signed char INT8
;
91 #define MIN(x,y) (((x) < (y)) ? (x) : (y))
94 void ne_vwarn (const char *fmt
, va_list ap
)
95 ATTRIBUTE_PRINTF(1,0);
96 void ne_warn (const char *fmt
, ...)
97 ATTRIBUTE_PRINTF(1,2);
98 UINT32
ne_crc (UINT8
*data
, UINT32 bytes
);
102 #endif /* incl_HPHP_NEO_MISC_H_ */