gecko-dev/include/resdef.h

130 lines
3.6 KiB
C
Raw Normal View History

1998-03-28 02:44:41 +00:00
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
1998-03-28 02:44:41 +00:00
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
1998-03-28 02:44:41 +00:00
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
1998-03-28 02:44:41 +00:00
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
1998-03-28 02:44:41 +00:00
*/
#ifndef _RESDEF_H_
#define _RESDEF_H_
#include "xp_core.h"
1998-09-25 16:23:07 +00:00
/* BEGING NEW_STRING_LIB */
#define RES_OFFSET 7000
/* END NEW_STRING_LIB */
/*
1998-06-22 21:21:28 +00:00
#ifdef XP_MAC
#define RES_OFFSET 4000
#else
1998-03-28 02:44:41 +00:00
#define RES_OFFSET 7000
1998-06-22 21:21:28 +00:00
#endif
1998-09-25 16:23:07 +00:00
*/
1998-03-28 02:44:41 +00:00
#ifndef RESOURCE_STR
#ifdef WANT_ENUM_STRING_IDS
#define RES_START
#if defined(XP_WIN) && _MSC_VER == 1100
/* VC50 has a bug, where large enumerations cause an
* internal compiler error. Do some hack here to fix without
* breaking the other platforms.
*/
#define BEGIN_STR(arg)
#define ResDef(name,id,msg) enum { name=id };
#define END_STR(arg)
#else /* XP_WIN _MSC_VER */
#define BEGIN_STR(arg) enum {
#define ResDef(name,id,msg) name=id,
#if defined(XP_WIN)
#define END_STR(arg) };
#else
#define END_STR(arg) arg=0 };
#endif
#endif /* XP_WIN _MSC_VER */
#else /* WANT_ENUM_STRING_IDS */
#define RES_START
#define BEGIN_STR(arg)
#ifdef XP_WIN16
/* Get these ints out of DGROUP (/Gt3 compiler switch)
* so we can increase the stack size
*/
#define ResDef(name,id,msg) int __far name = (id);
#else
#define ResDef(name,id,msg) int name = (id);
#endif
#define END_STR(arg)
#endif /* WANT_ENUM_STRING_IDS */
#else /* RESOURCE_STR, the definition here is for building resources */
#if defined(XP_WIN) || defined(XP_OS2)
#ifndef MOZILLA_CLIENT
#define RES_START
1999-07-16 17:39:03 +00:00
#define BEGIN_STR(arg) static char * (arg) (int32 i) { switch (i) {
1998-03-28 02:44:41 +00:00
#define ResDef(name,id,msg) case (id)+RES_OFFSET: return (msg);
#define END_STR(arg) } return NULL; }
#else /* MOZILLA_CLIENT */
#define RES_START STRINGTABLE DISCARDABLE
#define BEGIN_STR(arg) BEGIN
#define ResDef(name,id,msg) id+RES_OFFSET msg
#define END_STR(arg) END
#endif /* not MOZILLA_CLIENT */
#elif defined(XP_MAC)
/* Do nothing -- leave ResDef() to be perl'ized via MPW */
1998-09-25 16:23:07 +00:00
/*#define ResDef(name,id,msg) ResDef(name,id,msg)*/
/* BEGIN NEW_STRING_LIB */
#define RES_START
#define BEGIN_STR(arg) char* (arg)(long i); \
char* (arg)(long i) { switch (i) {
#define ResDef(name,id,msg) case ((id)+RES_OFFSET): return (msg);
#define END_STR(arg) default: return NULL;} return NULL; }
/* END NEW_STRING_LIB */
1998-03-28 02:44:41 +00:00
#elif defined(XP_UNIX)
1999-06-26 21:39:54 +00:00
1998-03-28 02:44:41 +00:00
#ifdef RESOURCE_STR_X
#define RES_START
#define BEGIN_STR(arg) static char *(arg)(void) {
#define ResDef(name,id,msg) output((id)+RES_OFFSET, (msg));
#define END_STR(arg) }
#else
#define RES_START
1999-07-16 17:39:03 +00:00
#define BEGIN_STR(arg) static char *(arg)(int32 i) { switch (i) {
1998-03-28 02:44:41 +00:00
#define ResDef(name,id,msg) case (id)+RES_OFFSET: return (msg);
#define END_STR(arg) } return NULL; }
#endif /* RESOURCE_STR_X */
1999-06-26 21:39:54 +00:00
#elif defined(XP_BEOS)
#define RES_START
#define BEGIN_STR(arg) static char *(arg)(int32 i) { switch (i) {
#define ResDef(name,id,msg) case (id)+RES_OFFSET: return (msg);
#define END_STR(arg) } return NULL; }
1998-03-28 02:44:41 +00:00
#endif /* XP_WIN */
#endif /* RESOURCE_STR */
#endif /* _RESDEF_H_ */