Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
nl_types.h
Go to the documentation of this file.
00001 
00002 /* This file intercepts any system version of <nl_types.h>.  Not all
00003    systems support gencat, catgets(), catgetmsg(), etc. and this file
00004    provides a workaround.
00005    
00006    Cygwin and MacOS are examples of systems without gencat functionality.
00007 
00008    See below for workaround solution.
00009 */
00010 
00011 #ifndef NL_TYPES_INTERCEPTOR_H
00012 #define NL_TYPES_INTERCEPTOR_H 1
00013 
00014 /****************************************************************************/
00015 
00016 /* We replace catopen(), catclose(), catgets(), catgetmsg(), etc. with
00017    our own version located in
00018      Open64/osprey1.0/libcsup/msgnew/mycat.*
00019 
00020   Currently we do this on *all* systems.  */
00021 
00022 #if !defined(DISABLE_NL_TYPES_SYMBOL_RENAMING)
00023 
00024 # define catopen    my_catopen
00025 # define catclose   my_catclose
00026 # define catgets    my_catgets
00027 # define catgetmsg  my_catgetmsg
00028 # define catmsgfmt  my_catmsgfmt
00029 
00030 #endif
00031 
00032 /****************************************************************************/
00033 
00034 /* Declare/define certain things provided by <nl_types.h> */
00035 
00036 #if !(defined(__CYGWIN__) || defined(__MACH__))
00037 
00038   /* Include the system's <nl_types.h> */
00039 # include <../../usr/include/nl_types.h>
00040 
00041 #else
00042 
00043   /* Must manually provide <nl_types.h> */
00044 
00045   /* The default message set used by the gencat program.  */
00046 # define NL_SETD 1
00047 
00048   /* Value for FLAG parameter of `catgets' to say we want XPG4 compliance.  */
00049 # define NL_CAT_LOCALE 1
00050 
00051   /* Message catalog descriptor type.  */
00052   typedef void *nl_catd;
00053 
00054   /* Type used by `nl_langinfo'.  */
00055   typedef int nl_item;
00056 
00057 
00058 # ifdef __cplusplus
00059   extern "C" {
00060 # endif
00061     
00062     extern nl_catd catopen(const char *name, int oflag);
00063     extern int catclose(nl_catd catd);
00064     extern char *catgets(nl_catd catd, int set_num, int msg_num,
00065                          const char *s);
00066 
00067     /* These stubs can be used as quick workaround. */
00068 #if 0
00069 #   define catopen(cat_name, flag) ((nl_catd)42)
00070 #   define catclose(catalog)       ((int)0)
00071 #   define catgets(catalog, set, number, string) \
00072       ((char*)"catgets: Bogus message.")
00073 #endif
00074 
00075 # ifdef __cplusplus
00076   }
00077 # endif
00078 
00079   /* Extra declarations provided by <cray/nlcatmsg.h> in appropriate
00080      source files. */
00081 
00082 #endif
00083 
00084 /****************************************************************************/
00085 
00086 #endif /* NL_TYPES_INTERCEPTOR_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines