/[pcre]/code/branches/pcre16/sljit/sljitConfigInternal.h
ViewVC logotype

Diff of /code/branches/pcre16/sljit/sljitConfigInternal.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

code/trunk/sljit/sljitConfigInternal.h revision 662 by ph10, Mon Aug 22 14:35:22 2011 UTC code/branches/pcre16/sljit/sljitConfigInternal.h revision 781 by zherczeg, Sat Dec 3 07:58:30 2011 UTC
# Line 119  Line 119 
119    
120  #if !(defined SLJIT_STD_MACROS_DEFINED && SLJIT_STD_MACROS_DEFINED)  #if !(defined SLJIT_STD_MACROS_DEFINED && SLJIT_STD_MACROS_DEFINED)
121    
122    /* These libraries are needed for the macros below. */
123  #include <stdlib.h>  #include <stdlib.h>
124  #include <string.h>  #include <string.h>
125    
126  /* General libraries:  #endif /* STD_MACROS_DEFINED */
127    
128    /* General macros:
129     Note: SLJIT is designed to be independent from them as possible.     Note: SLJIT is designed to be independent from them as possible.
130    
131     In release mode (SLJIT_DEBUG is not defined) only the following macros are needed: */     In release mode (SLJIT_DEBUG is not defined) only the following macros are needed:
132    */
133    
134  /* General allocation. */  #ifndef SLJIT_MALLOC
135  #define SLJIT_MALLOC(size) malloc(size)  #define SLJIT_MALLOC(size) malloc(size)
136    #endif
137    
138    #ifndef SLJIT_FREE
139  #define SLJIT_FREE(ptr) free(ptr)  #define SLJIT_FREE(ptr) free(ptr)
140    #endif
141    
142    #ifndef SLJIT_MEMMOVE
143  #define SLJIT_MEMMOVE(dest, src, len) memmove(dest, src, len)  #define SLJIT_MEMMOVE(dest, src, len) memmove(dest, src, len)
144    #endif
145    
146  #endif /* STD_MACROS_DEFINED */  #ifndef SLJIT_ZEROMEM
147    #define SLJIT_ZEROMEM(dest, len) memset(dest, 0, len)
148    #endif
149    
150  #if !defined(SLJIT_LIKELY) && !defined(SLJIT_UNLIKELY)  #if !defined(SLJIT_LIKELY) && !defined(SLJIT_UNLIKELY)
151    
# Line 161  Line 174 
174  #define SLJIT_UNUSED_ARG(arg) (void)arg  #define SLJIT_UNUSED_ARG(arg) (void)arg
175  #endif  #endif
176    
177    #if (defined SLJIT_CONFIG_STATIC && SLJIT_CONFIG_STATIC)
178    /* Static ABI functions. For all-in-one programs. */
179    
180    #if defined(__GNUC__)
181    /* Disable unused warnings in gcc. */
182    #define SLJIT_API_FUNC_ATTRIBUTE static __attribute__((unused))
183    #else
184    #define SLJIT_API_FUNC_ATTRIBUTE static
185    #endif
186    
187    #else
188    #define SLJIT_API_FUNC_ATTRIBUTE
189    #endif /* (defined SLJIT_CONFIG_STATIC && SLJIT_CONFIG_STATIC) */
190    
191  #ifndef SLJIT_CACHE_FLUSH  #ifndef SLJIT_CACHE_FLUSH
192    
193  #if !(defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) && !(defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)  #if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
194          /* Just call __ARM_NR_cacheflush on Linux. */  
195    /* The __clear_cache() implementation of GCC is a dummy function on PowerPC. */
196  #define SLJIT_CACHE_FLUSH(from, to) \  #define SLJIT_CACHE_FLUSH(from, to) \
197          __clear_cache((char*)(from), (char*)(to))          ppc_cache_flush((from), (to))
198  #else  
199          /* Not required to implement on archs with unified caches. */  #elif (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) || (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
200    
201    /* Not required to implement on archs with unified caches. */
202  #define SLJIT_CACHE_FLUSH(from, to)  #define SLJIT_CACHE_FLUSH(from, to)
203    
204    #else
205    
206    /* Calls __ARM_NR_cacheflush on ARM-Linux. */
207    #define SLJIT_CACHE_FLUSH(from, to) \
208            __clear_cache((char*)(from), (char*)(to))
209    
210  #endif  #endif
211    
212  #endif /* !SLJIT_CACHE_FLUSH */  #endif /* !SLJIT_CACHE_FLUSH */
# Line 225  typedef long int sljit_w; Line 262  typedef long int sljit_w;
262  /* ABI (Application Binary Interface) types. */  /* ABI (Application Binary Interface) types. */
263  #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)  #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
264    
265  #ifdef __GNUC__  #if defined(__GNUC__)
266    
267  #define SLJIT_CALL __attribute__ ((fastcall))  #define SLJIT_CALL __attribute__ ((fastcall))
268  #define SLJIT_X86_32_FASTCALL 1  #define SLJIT_X86_32_FASTCALL 1
269    
270  #elif defined(_WIN32)  #elif defined(_WIN32)
271    
272    #ifdef __BORLANDC__
273    #define SLJIT_CALL __msfastcall
274    #else /* __BORLANDC__ */
275  #define SLJIT_CALL __fastcall  #define SLJIT_CALL __fastcall
276    #endif /* __BORLANDC__ */
277  #define SLJIT_X86_32_FASTCALL 1  #define SLJIT_X86_32_FASTCALL 1
278  #else  
279    #else /* defined(_WIN32) */
280  #define SLJIT_CALL __stdcall  #define SLJIT_CALL __stdcall
281  #endif  #endif
282    
# Line 246  typedef long int sljit_w; Line 291  typedef long int sljit_w;
291  #if !defined(SLJIT_BIG_ENDIAN) && !defined(SLJIT_LITTLE_ENDIAN)  #if !defined(SLJIT_BIG_ENDIAN) && !defined(SLJIT_LITTLE_ENDIAN)
292    
293  /* These macros are useful for the application. */  /* These macros are useful for the application. */
294  #if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) || (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)  #if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
295  #define SLJIT_BIG_ENDIAN 1  #define SLJIT_BIG_ENDIAN 1
296    
297    #elif (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
298    
299    #ifdef __MIPSEL__
300    #define SLJIT_LITTLE_ENDIAN 1
301    #else
302    #define SLJIT_BIG_ENDIAN 1
303    #endif
304    
305  #else  #else
306  #define SLJIT_LITTLE_ENDIAN 1  #define SLJIT_LITTLE_ENDIAN 1
307  #endif  #endif
# Line 300  typedef long int sljit_w; Line 354  typedef long int sljit_w;
354  #endif /* !SLJIT_UNALIGNED */  #endif /* !SLJIT_UNALIGNED */
355    
356  #if (defined SLJIT_EXECUTABLE_ALLOCATOR && SLJIT_EXECUTABLE_ALLOCATOR)  #if (defined SLJIT_EXECUTABLE_ALLOCATOR && SLJIT_EXECUTABLE_ALLOCATOR)
357  void* sljit_malloc_exec(sljit_uw size);  SLJIT_API_FUNC_ATTRIBUTE void* sljit_malloc_exec(sljit_uw size);
358  void sljit_free_exec(void* ptr);  SLJIT_API_FUNC_ATTRIBUTE void sljit_free_exec(void* ptr);
359  #define SLJIT_MALLOC_EXEC(size) sljit_malloc_exec(size)  #define SLJIT_MALLOC_EXEC(size) sljit_malloc_exec(size)
360  #define SLJIT_FREE_EXEC(ptr) sljit_free_exec(ptr)  #define SLJIT_FREE_EXEC(ptr) sljit_free_exec(ptr)
361  #endif  #endif
# Line 315  void sljit_free_exec(void* ptr); Line 369  void sljit_free_exec(void* ptr);
369  /* Feel free to redefine these two macros. */  /* Feel free to redefine these two macros. */
370  #ifndef SLJIT_ASSERT  #ifndef SLJIT_ASSERT
371    
372    #define SLJIT_HALT_PROCESS() \
373            *((int*)0) = 0
374    
375  #define SLJIT_ASSERT(x) \  #define SLJIT_ASSERT(x) \
376          do { \          do { \
377                  if (SLJIT_UNLIKELY(!(x))) { \                  if (SLJIT_UNLIKELY(!(x))) { \
378                          printf("Assertion failed at " __FILE__ ":%d\n", __LINE__); \                          printf("Assertion failed at " __FILE__ ":%d\n", __LINE__); \
379                          *((int*)0) = 0; \                          SLJIT_HALT_PROCESS(); \
380                  } \                  } \
381          } while (0)          } while (0)
382    
# Line 330  void sljit_free_exec(void* ptr); Line 387  void sljit_free_exec(void* ptr);
387  #define SLJIT_ASSERT_STOP() \  #define SLJIT_ASSERT_STOP() \
388          do { \          do { \
389                  printf("Should never been reached " __FILE__ ":%d\n", __LINE__); \                  printf("Should never been reached " __FILE__ ":%d\n", __LINE__); \
390                  *((int*)0) = 0; \                  SLJIT_HALT_PROCESS(); \
391          } while (0)          } while (0)
392    
393  #endif /* !SLJIT_ASSERT_STOP */  #endif /* !SLJIT_ASSERT_STOP */
# Line 347  void sljit_free_exec(void* ptr); Line 404  void sljit_free_exec(void* ptr);
404    
405  #endif /* (defined SLJIT_DEBUG && SLJIT_DEBUG) */  #endif /* (defined SLJIT_DEBUG && SLJIT_DEBUG) */
406    
407    #ifndef SLJIT_COMPILE_ASSERT
408    
409    /* Should be improved eventually. */
410    #define SLJIT_COMPILE_ASSERT(x, description) \
411            SLJIT_ASSERT(x)
412    
413    #endif /* !SLJIT_COMPILE_ASSERT */
414    
415  #endif  #endif

Legend:
Removed from v.662  
changed lines
  Added in v.781

  ViewVC Help
Powered by ViewVC 1.1.5