crossworks.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #ifndef _TOOLCHAIN_CROSSWORKS_H_
  2. #define _TOOLCHAIN_CROSSWORKS_H_
  3. /*
  4. * Copyright (C) 2011-2014 by Michael Fischer
  5. *
  6. * All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. *
  12. * 1. Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. * 2. Redistributions in binary form must reproduce the above copyright
  15. * notice, this list of conditions and the following disclaimer in the
  16. * documentation and/or other materials provided with the distribution.
  17. * 3. Neither the name of the copyright holders nor the names of
  18. * contributors may be used to endorse or promote products derived
  19. * from this software without specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  24. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  25. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  26. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  27. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  28. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  29. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  30. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  31. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  32. * SUCH DAMAGE.
  33. *
  34. * For additional information see http://www.ethernut.de/
  35. */
  36. #ifndef __ASSEMBLER__
  37. #include <stddef.h>
  38. /*!
  39. * \brief Case insensitive string comparisons.
  40. *
  41. * Not supported by CrossWorks and temporarily redirected
  42. * to the stricmp and strnicmp routines.
  43. *
  44. */
  45. #define strcasecmp(s1, s2) stricmp(s1, s2)
  46. #define strncasecmp(s1, s2, n) strnicmp(s1, s2, n)
  47. /*
  48. * Not supported by CrossWorks, added prototypes here.
  49. */
  50. int stricmp(const char *s1, const char *s2);
  51. int strnicmp(const char *s1, const char *s2, size_t n);
  52. char *strdup(const char *str);
  53. /*
  54. * If "Enforce ANSI Checking" is enabled, which is
  55. * the default from the v2.x version of CrossWorks
  56. * the keyword asm will not be recognized. Therefore
  57. * the next define is needed to solve the problem.
  58. */
  59. #define asm __asm__
  60. /*
  61. * Define for __BEGIN_DECLS and __END_DECLS
  62. */
  63. #ifdef __cplusplus
  64. # define __BEGIN_DECLS extern "C" {
  65. # define __END_DECLS }
  66. #else
  67. # define __BEGIN_DECLS
  68. # define __END_DECLS
  69. #endif
  70. #endif /* __ASSEMBLER__ */
  71. #endif /* _TOOLCHAIN_CROSSWORKS_H_ */
  72. /*** EOF ***/