asisys.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2015 Autodesk, Inc. All rights reserved.
  4. //
  5. // Use of this software is subject to the terms of the Autodesk license
  6. // agreement provided at the time of installation or download, or which
  7. // otherwise accompanies this software in either electronic or hard copy form.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. //
  11. // Name: asisys.h ast_asi_inc_ddk_asisys_h
  12. //
  13. // Description: Header file for AutoCAD SQL Interface.
  14. // Common utility functions.
  15. #ifndef ASI_ASISYS_H
  16. #define ASI_ASISYS_H asisysh
  17. /***************************************************************************/
  18. /* INCLUDES */
  19. /***************************************************************************/
  20. #include <tchar.h>
  21. /***************************************************************************/
  22. /* DEFINES */
  23. /***************************************************************************/
  24. #ifdef BUILD_DBCONNECT
  25. #pragma warning(error:4700)
  26. // TODO: As part of VC7 warning cleanup work, submission V076-nm1.txt
  27. // changed project settings for all .vcproj files in the autocad
  28. // build tree. Doing this for AST generated the following two
  29. // warnings which were treated as errors. Since this submission was
  30. // made late in the RedDeer game, it was decided to keep the
  31. // changes minimal. So, for time being these two warnings are being
  32. // with pragmas. This has to be re-visited for Neo and the pragmas
  33. // will have to be removed.
  34. #pragma warning(disable:4290)
  35. #pragma warning(disable:4297)
  36. #endif
  37. #ifdef DLL_EXPORT
  38. #define DLLScope __declspec( dllexport )
  39. #else
  40. #define DLLScope __declspec( dllimport )
  41. #endif
  42. #ifdef DBINITCONSTANTS
  43. #define GLOBAL_(type, name, val) type name = val
  44. #else
  45. #define GLOBAL_(type, name, val) extern type name
  46. #endif
  47. #ifndef MAX
  48. # define MIN(a,b) ( (a) < (b) ? (a) : (b) )
  49. # define MAX(a,b) ( (a) > (b) ? (a) : (b) )
  50. #endif
  51. #ifndef NUMELEM
  52. # define NUMELEM(x) (sizeof(x)/sizeof(*x))
  53. #endif
  54. // Error processing macros
  55. #define RETURN_IF_FAILED(hr) { \
  56. HRESULT tmpHr; \
  57. tmpHr = (hr); \
  58. if(FAILED((tmpHr))) return tmpHr; \
  59. }
  60. #define THROW_IF_FAILED(hr) { \
  61. HRESULT tmpHr; \
  62. tmpHr = (hr); \
  63. if(FAILED((tmpHr))) throw (tmpHr); \
  64. }
  65. /***************************************************************************/
  66. /* FUNCTION PROTOTYPES */
  67. /***************************************************************************/
  68. #ifdef __cplusplus
  69. extern "C" {
  70. #endif /* __cplusplus */
  71. #pragma pack (push, 8)
  72. /* Memory functions */
  73. DLLScope long AsiObjectsInUse (void);
  74. DLLScope void * AsiMemoryMalloc (size_t);
  75. DLLScope void AsiMemoryFree (void*);
  76. DLLScope void * AsiMemoryRealloc (void*,size_t);
  77. DLLScope void * AsiMemoryAddMsg (void*,const TCHAR *);
  78. #pragma pack (pop)
  79. #ifdef __cplusplus
  80. }
  81. #endif /* __cplusplus */
  82. #endif /* ASI_ASISYS_H */
  83. /*EOF*/