home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / include / resdef.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.0 KB  |  102 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #ifndef _RESDEF_H_
  20. #define _RESDEF_H_
  21.  
  22. #include "xp_core.h"
  23.  
  24. #define RES_OFFSET 7000
  25.  
  26.  
  27. #ifndef RESOURCE_STR
  28.  
  29. #ifdef WANT_ENUM_STRING_IDS
  30.  
  31. #define RES_START
  32. #if defined(XP_WIN) && _MSC_VER == 1100
  33. /* VC50 has a bug, where large enumerations cause an
  34.  *  internal compiler error.  Do some hack here to fix without
  35.  *  breaking the other platforms.
  36.  */
  37. #define BEGIN_STR(arg)
  38. #define ResDef(name,id,msg) enum { name=id };
  39. #define END_STR(arg)
  40. #else /* XP_WIN _MSC_VER */
  41. #define BEGIN_STR(arg)   enum {
  42. #define ResDef(name,id,msg)    name=id,
  43. #if defined(XP_WIN)
  44. #define END_STR(arg)    };
  45. #else
  46. #define END_STR(arg)     arg=0 };
  47. #endif
  48. #endif /* XP_WIN _MSC_VER */
  49.  
  50. #else /* WANT_ENUM_STRING_IDS */
  51.  
  52. #define RES_START
  53. #define BEGIN_STR(arg)
  54. #ifdef XP_WIN16
  55. /*  Get these ints out of DGROUP (/Gt3 compiler switch)
  56.  *      so we can increase the stack size
  57.  */
  58. #define ResDef(name,id,msg)    int __far name = (id);
  59. #else
  60. #define ResDef(name,id,msg)    int name = (id);
  61. #endif
  62. #define END_STR(arg)
  63.  
  64. #endif /* WANT_ENUM_STRING_IDS */
  65.  
  66. #else  /* RESOURCE_STR, the definition here is for building resources */
  67. #if defined(XP_WIN) || defined(XP_OS2)
  68.  
  69. #ifndef MOZILLA_CLIENT
  70. #define RES_START
  71. #define BEGIN_STR(arg) static char * (arg) (int16 i) { switch (i) {
  72. #define ResDef(name,id,msg)    case (id)+RES_OFFSET: return (msg);
  73. #define END_STR(arg) } return NULL; }
  74. #else /* MOZILLA_CLIENT */
  75. #define RES_START STRINGTABLE DISCARDABLE
  76. #define BEGIN_STR(arg)  BEGIN
  77. #define ResDef(name,id,msg)    id+RES_OFFSET msg
  78. #define END_STR(arg)   END
  79. #endif /* not MOZILLA_CLIENT */
  80.  
  81. #elif defined(XP_MAC)
  82.     /* Do nothing -- leave ResDef() to be perl'ized via MPW */
  83. #define ResDef(name,id,msg)    ResDef(name,id,msg)
  84.  
  85. #elif defined(XP_UNIX)
  86. #ifdef RESOURCE_STR_X
  87. #define RES_START
  88. #define BEGIN_STR(arg) static char *(arg)(void) {
  89. #define ResDef(name,id,msg)    output((id)+RES_OFFSET, (msg));
  90. #define END_STR(arg) }
  91. #else
  92. #define RES_START
  93. #define BEGIN_STR(arg) static char *(arg)(int16 i) { switch (i) {
  94. #define ResDef(name,id,msg)    case (id)+RES_OFFSET: return (msg);
  95. #define END_STR(arg) } return NULL; }
  96. #endif /* RESOURCE_STR_X */
  97. #endif   /*  XP_WIN  */
  98. #endif /* RESOURCE_STR   */
  99.  
  100.  
  101. #endif /* _RESDEF_H_ */
  102.