switched many #ifdef's to #if defined()

This commit is contained in:
hyung-hwan 2014-11-14 02:44:20 +00:00
parent 3db3396955
commit 0b286a7e2a
68 changed files with 156 additions and 156 deletions

View File

@ -178,13 +178,13 @@ static int setsignal (int sig, void(*handler)(int), int restart)
if (restart)
{
#ifdef SA_RESTART
#if defined(SA_RESTART)
sa_int.sa_flags |= SA_RESTART;
#endif
}
else
{
#ifdef SA_INTERRUPT
#if defineed(SA_INTERRUPT)
sa_int.sa_flags |= SA_INTERRUPT;
#endif
}
@ -347,7 +347,7 @@ static void dprint_return (qse_awk_rtx_t* rtx, qse_awk_val_t* ret)
dprint (QSE_T("[END NAMED VARIABLES]\n"));
}
#ifdef ENABLE_CALLBACK
#if defined(ENABLE_CALLBACK)
static void on_statement (qse_awk_rtx_t* rtx, qse_awk_nde_t* nde)
{
dprint (QSE_T("running %d at line %zu\n"), (int)nde->type, (qse_size_t)nde->loc.line);
@ -998,7 +998,7 @@ static int awk_main (int argc, qse_char_t* argv[])
struct arg_t arg;
int ret = -1;
#ifdef ENABLE_CALLBACK
#if defined(ENABLE_CALLBACK)
static qse_awk_rtx_ecb_t rtx_ecb =
{
QSE_FV(.close, QSE_NULL),
@ -1111,7 +1111,7 @@ static int awk_main (int argc, qse_char_t* argv[])
}
app_rtx = rtx;
#ifdef ENABLE_CALLBACK
#if defined(ENABLE_CALLBACK)
qse_awk_rtx_pushecb (rtx, &rtx_ecb);
#endif

View File

@ -518,13 +518,13 @@ static int setsignal (int sig, void(*handler)(int), int restart)
if (restart)
{
#ifdef SA_RESTART
#if defined(SA_RESTART)
sa_int.sa_flags |= SA_RESTART;
#endif
}
else
{
#ifdef SA_INTERRUPT
#if defined(SA_INTERRUPT)
sa_int.sa_flags |= SA_INTERRUPT;
#endif
}

View File

@ -85,7 +85,7 @@ struct qse_awk_parsestd_t
typedef struct qse_awk_parsestd_t qse_awk_parsestd_t;
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -183,7 +183,7 @@ QSE_EXPORT qse_cmgr_t* qse_awk_rtx_getcmgrstd (
const qse_char_t* ioname
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -54,7 +54,7 @@ typedef int (*qse_search_comper_t) (
*/
typedef qse_search_comper_t qse_sort_comper_t;
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -214,7 +214,7 @@ QSE_EXPORT qse_size_t qse_debase64 (
qse_size_t* xsz
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -162,7 +162,7 @@ typedef qse_ctype_t qse_wctype_t;
((c) >= QSE_WT('A') && (c) <= QSE_WT('F'))? ((c) - QSE_WT('A') + 10): \
((c) >= QSE_WT('a') && (c) <= QSE_WT('f'))? ((c) - QSE_WT('a') + 10): -1)
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -220,7 +220,7 @@ QSE_EXPORT int qse_wcsntoctype (
# define qse_strntoctype(name,len,id) qse_wcsntoctype(name,len,id)
#endif
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -34,7 +34,7 @@
*/
#define QSE_CP949LEN_MAX 2
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -96,7 +96,7 @@ QSE_EXPORT qse_size_t qse_cp949lenmax (
void
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -34,7 +34,7 @@
*/
#define QSE_CP950LEN_MAX 2
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -96,7 +96,7 @@ QSE_EXPORT qse_size_t qse_cp950lenmax (
void
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -62,7 +62,7 @@ struct qse_dir_ent_t
const qse_char_t* name;
};
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -100,7 +100,7 @@ QSE_EXPORT int qse_dir_read (
qse_dir_ent_t* ent
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -118,7 +118,7 @@ struct qse_dll_t
#define QSE_DLL_DPTR(node) ((node)->val.ptr)
#define QSE_DLL_DLEN(node) ((node)->val.len)
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -331,7 +331,7 @@ QSE_EXPORT void qse_dll_poptail (
qse_dll_t* dll
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -203,7 +203,7 @@ struct qse_fma_t
qse_fma_blk_t* freeblk; /**< point to the first free block */
};
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -300,7 +300,7 @@ QSE_EXPORT void qse_fma_free (
void* blk /**< memory block to free */
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -117,7 +117,7 @@ enum qse_fmtintmax_flag_t
#define QSE_FMTUINTMAXTOWCS_FILLRIGHT QSE_FMTINTMAX_FILLRIGHT
#define QSE_FMTUINTMAXTOWCS_FILLCENTER QSE_FMTINTMAX_FILLCENTER
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -299,7 +299,7 @@ QSE_EXPORT int qse_fmtfltmaxtombs (
int digits
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -109,7 +109,7 @@ enum qse_fs_option_t
QSE_FS_REALPATH = (1 << 2)
};
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -174,7 +174,7 @@ QSE_EXPORT int qse_fs_delete (
const qse_char_t* path
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -183,7 +183,7 @@ struct qse_gdl_link_t
#define QSE_GDL_ISHEAD(gdl,x) ((x)->prev == (qse_gdl_link_t*)(gdl))
#define QSE_GDL_ISTAIL(gdl,x) ((x)->next == (qse_gdl_link_t*)(gdl))
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -205,7 +205,7 @@ QSE_EXPORT void qse_gdl_replace (
qse_gdl_link_t* new_link
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -51,7 +51,7 @@ enum qse_glob_flags_t
QSE_GLOB_TOLERANT = (1 << 3)
};
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -69,7 +69,7 @@ QSE_EXPORT int qse_glob (
qse_mmgr_t* mmgr
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -295,7 +295,7 @@ struct qse_htb_t
#define QSE_HTB_NEXT(p) ((p)->next)
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -657,7 +657,7 @@ QSE_EXPORT int qse_htb_dflcomp (
qse_size_t klen2
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -24,7 +24,7 @@
#include <qse/types.h>
#include <qse/macros.h>
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -68,7 +68,7 @@ QSE_EXPORT qse_uint128_t qse_hton128 (
);
#endif
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -39,7 +39,7 @@ struct qse_ip6ad_t
};
#include <qse/unpack.h>
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -153,7 +153,7 @@ QSE_EXPORT int qse_prefixtoip6ad (
qse_ip6ad_t* ipad
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -150,7 +150,7 @@ struct qse_lda_slot_t
qse_xptl_t val;
};
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -421,7 +421,7 @@ QSE_EXPORT void qse_lda_popheap (
qse_lda_t* lda
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -78,7 +78,7 @@ typedef int (*qse_runmainwithenv_handler_t) (
qse_char_t* envp[]
);
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -107,7 +107,7 @@ QSE_EXPORT int qse_runmainwithenv (
/* TODO: support more weird main functions. for example,
* int main(int argc, char **argv, char **envp, char **apple) in Mac OS X */
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -28,7 +28,7 @@
* This file provides functions, types, macros for mb8 conversion.
*/
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -63,7 +63,7 @@ qse_size_t qse_mb8towc (
qse_wchar_t* wc
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -59,7 +59,7 @@ enum qse_cmgr_id_t
};
typedef enum qse_cmgr_id_t qse_cmgr_id_t;
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -464,7 +464,7 @@ QSE_EXPORT qse_mchar_t* qse_wcsnatombsdup (
qse_mmgr_t* mmgr
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -55,7 +55,7 @@
*/
#define QSE_MMGR_FREE(mmgr,ptr) ((mmgr)->free(mmgr,ptr))
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -193,7 +193,7 @@ QSE_EXPORT void qse_setdflmmgr (
qse_mmgr_t* mmgr
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -66,7 +66,7 @@ struct qse_nwifcfg_t
qse_uint8_t ethw[6]; /* out */
};
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -118,7 +118,7 @@ QSE_EXPORT int qse_getnwifcfg (
qse_nwifcfg_t* cfg
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -102,7 +102,7 @@ struct qse_nwio_t
#define QSE_NWIO_HANDLE(nwio) ((nwio)->handle)
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -206,7 +206,7 @@ QSE_EXPORT qse_ssize_t qse_nwio_write (
qse_size_t size
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -140,7 +140,7 @@ typedef qse_oht_walk_t (*qse_oht_walker_t) (
void* ctx
);
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -305,7 +305,7 @@ QSE_EXPORT void qse_oht_walk (
void* ctx /**< context */
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -58,7 +58,7 @@ struct qse_opt_t
qse_char_t* cur;
};
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -84,7 +84,7 @@ QSE_EXPORT qse_cint_t qse_getopt (
qse_opt_t* opt /* option configuration */
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -60,7 +60,7 @@ enum qse_canonpath_flag_t
# define QSE_ISPATHWCSEP(c) ((c) == QSE_WT('/'))
#endif
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -242,7 +242,7 @@ QSE_EXPORT qse_size_t qse_canonwcspath (
# define qse_canonpath(p,c,f) qse_canonwcspath(p,c,f)
#endif
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -66,7 +66,7 @@ struct qse_pma_t
int failed;
};
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif

View File

@ -266,7 +266,7 @@ struct qse_rbt_t
#define QSE_RBT_NEXT(p) ((p)->next)
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -590,7 +590,7 @@ QSE_EXPORT int qse_rbt_dflcomp (
qse_size_t klen2
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -199,7 +199,7 @@ struct qse_rex_t
qse_rex_node_t* code;
};
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -307,7 +307,7 @@ QSE_EXPORT void qse_freerex (
void* code
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -63,7 +63,7 @@ enum qse_shutsckhnd_how_t
};
typedef enum qse_shutsckhnd_how_t qse_shutsckhnd_how_t;
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -81,7 +81,7 @@ QSE_EXPORT void qse_shutsckhnd (
qse_shutsckhnd_how_t how
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -130,7 +130,7 @@ struct qse_sio_t
/** access the @a errnum field of the #qse_sio_t structure */
#define QSE_SIO_ERRNUM(sio) ((sio)->errnum)
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -449,7 +449,7 @@ QSE_EXPORT qse_ssize_t qse_errputwcsvf (
#define qse_fflush qse_sio_flush
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -150,7 +150,7 @@ struct qse_sll_node_t
*/
#define QSE_SLL_NEXT(node) ((node)->next)
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -392,7 +392,7 @@ QSE_EXPORT void qse_sll_poptail (
qse_sll_t* sll
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -49,7 +49,7 @@ struct qse_mbstate_t
/* SYSTEM LOCALE BASED CHARACTER CONVERSION */
/* --------------------------------------------------- */
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -124,7 +124,7 @@ QSE_EXPORT qse_size_t qse_slmblenmax (
void
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -33,7 +33,7 @@ typedef qse_task_slice_t* (*qse_task_fnc_t) (
void* ctx
);
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -73,7 +73,7 @@ QSE_EXPORT void qse_task_schedule (
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -115,7 +115,7 @@ struct qse_btime_t
(((x)->sec == (y)->sec)? ((x)->nsec - (y)->nsec): \
((x)->sec - (y)->sec))
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -187,7 +187,7 @@ QSE_EXPORT void qse_subtime (
qse_ntime_t* z
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -124,7 +124,7 @@ struct qse_tio_t
qse_size_t outbuf_len;
};
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -311,7 +311,7 @@ QSE_EXPORT qse_ssize_t qse_tio_writewcs (
# define qse_tio_write(tio,str,size) qse_tio_writewcs(tio,str,size)
#endif
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -99,7 +99,7 @@ enum qse_tre_eflag_t
QSE_TRE_NOTEOL = (1 << 2)
};
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -169,7 +169,7 @@ QSE_EXPORT int qse_tre_exec (
int eflags
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -30,7 +30,7 @@
#include <qse/macros.h>
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -49,7 +49,7 @@ QSE_EXPORT int qse_isunipunct (qse_wcint_t c);
QSE_EXPORT qse_wcint_t qse_touniupper (qse_wcint_t c);
QSE_EXPORT qse_wcint_t qse_tounilower (qse_wcint_t c);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -83,7 +83,7 @@ enum qse_wcstouri_flag_t
typedef qse_wuri_t qse_uri_t;
#endif
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -105,7 +105,7 @@ QSE_EXPORT int qse_wcstouri (
#define qse_strtouri(str,uri,flags) qse_wcstouri(str,uri,flags)
#endif
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -40,7 +40,7 @@
# error Unsupported wide-character size
#endif
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -102,7 +102,7 @@ qse_size_t qse_utf8lenmax (
void
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -114,7 +114,7 @@ typedef int (*qse_xma_dumper_t) (
...
);
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -215,7 +215,7 @@ QSE_EXPORT void qse_xma_dump (
void* ctx /**< first parameter to output function */
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -132,7 +132,7 @@ struct qse_upxd_cbs_t
typedef struct qse_upxd_cbs_t qse_upxd_cbs_t;
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -233,7 +233,7 @@ QSE_EXPORT int qse_upxd_poll (
qse_ntime_t timeout
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -153,7 +153,7 @@
* The #QSE_NULL macro defines a special pointer value to indicate an error or
* that it does not point to anything.
*/
#ifdef __cplusplus
#if defined(__cplusplus)
# if QSE_SIZEOF_VOID_P == QSE_SIZEOF_INT
# define QSE_NULL (0)
# elif QSE_SIZEOF_VOID_P == QSE_SIZEOF_LONG
@ -310,20 +310,20 @@
(qse_assert_failed (QSE_T(#expr), QSE_T(desc), QSE_T(__FILE__), __LINE__), 0))
#endif
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
QSE_EXPORT void qse_assert_failed (
const qse_char_t* expr, const qse_char_t* desc,
const qse_char_t* file, qse_size_t line);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif
/* ----------------------------------------------------------------------
* C++ NAMESPACE
* ---------------------------------------------------------------------- */
#ifdef __cplusplus
#if defined(__cplusplus)
# define QSE_BEGIN_NAMESPACE(x) namespace x {
# define QSE_END_NAMESPACE(x) }
# define QSE_BEGIN_NAMESPACE2(x,y) namespace x { namespace y {

View File

@ -403,7 +403,7 @@ enum qse_sed_space_t
};
typedef enum qse_sed_space_t qse_sed_space_t;
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -725,7 +725,7 @@ QSE_EXPORT void qse_sed_getspace (
qse_cstr_t* str
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -91,7 +91,7 @@ struct qse_sed_iostd_t
typedef struct qse_sed_iostd_t qse_sed_iostd_t;
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -234,7 +234,7 @@ QSE_EXPORT int qse_sed_execstdxstr (
qse_cmgr_t* cmgr
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -86,7 +86,7 @@ struct qse_xli_iostd_t
typedef struct qse_xli_iostd_t qse_xli_iostd_t;
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -131,7 +131,7 @@ QSE_EXPORT int qse_xli_writestd (
qse_xli_iostd_t* out
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -21,13 +21,13 @@
#ifndef _QSE_LIB_AWK_ERR_H_
#define _QSE_LIB_AWK_ERR_H_
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
const qse_char_t* qse_awk_dflerrstr (const qse_awk_t* awk, qse_awk_errnum_t errnum);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -38,7 +38,7 @@ struct qse_awk_fnc_t
qse_awk_mod_t* mod; /* set by the engine to a valid pointer if it's associated to a module */
};
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -57,7 +57,7 @@ QSE_EXPORT int qse_awk_fnc_tolower (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t
QSE_EXPORT int qse_awk_fnc_toupper (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi);
QSE_EXPORT int qse_awk_fnc_sprintf (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -21,7 +21,7 @@
#ifndef _QSE_LIB_AWK_MISC_H_
#define _QSE_LIB_AWK_MISC_H_
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -86,7 +86,7 @@ int qse_awk_rtx_matchrex (
qse_cstr_t* match
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -53,7 +53,7 @@ enum qse_awk_kwid_t
typedef enum qse_awk_kwid_t qse_awk_kwid_t;
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -88,7 +88,7 @@ void qse_awk_clearsionames (
qse_awk_t* awk
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -21,7 +21,7 @@
#ifndef _QSE_LIB_AWK_RIO_H_
#define _QSE_LIB_AWK_RIO_H_
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -54,7 +54,7 @@ int qse_awk_rtx_closeio (
void qse_awk_rtx_cleario (qse_awk_rtx_t* run);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -102,7 +102,7 @@ enum qse_awk_incop_type_t
QSE_AWK_INCOP_MINUS
};
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -117,7 +117,7 @@ qse_char_t* qse_awk_rtx_format (
qse_size_t* len
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -303,7 +303,7 @@ struct qse_awk_nde_print_t
qse_awk_nde_t* out;
};
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -316,7 +316,7 @@ int qse_awk_prnptnpt (qse_awk_t* awk, qse_awk_nde_t* tree);
void qse_awk_clrpt (qse_awk_t* awk, qse_awk_nde_t* tree);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -106,7 +106,7 @@ struct qse_awk_val_rchunk_t
#define QSE_AWK_RTX_GETVALTYPE(rtx,p) (IS_QUICKINT_POINTER(p)? QSE_AWK_VAL_INT: (p)->v_type)
#define QSE_AWK_RTX_GETINTFROMVAL(rtx,p) ((IS_QUICKINT_POINTER(p)? (qse_awk_int_t)GET_QUICKINT_FROM_POINTER(p): ((qse_awk_val_int_t*)(p))->i_val))
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -137,7 +137,7 @@ void qse_awk_rtx_freevalchunk (
qse_awk_val_chunk_t* chunk
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -203,7 +203,7 @@ qse_mcint_t qse_tomctype (qse_mcint_t c, qse_mctype_t type)
int qse_iswctype (qse_wcint_t c, qse_wctype_t type)
{
/*
#ifdef HAVE_WCTYPE
#if defined(HAVE_WCTYPE)
static const char* name[] =
{
"upper",
@ -298,7 +298,7 @@ int qse_iswctype (qse_wcint_t c, qse_wctype_t type)
qse_wcint_t qse_towctype (qse_wcint_t c, qse_wctype_t type)
{
/*
#ifdef HAVE_WCTRANS
#if defined(HAVE_WCTRANS)
static const char* name[] =
{
"toupper",

View File

@ -98,7 +98,7 @@ struct qse_wfmtout_t
typedef struct qse_wfmtout_t qse_wfmtout_t;
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -120,7 +120,7 @@ int qse_wfmtout (
# define qse_fmtout(fmt,fo,ap) qse_wfmtout(fmt,fo,ap)
#endif
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -37,7 +37,7 @@
typedef int qse_fs_syserr_t;
#endif
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -46,6 +46,6 @@ qse_fs_errnum_t qse_fs_syserrtoerrnum (
qse_fs_syserr_t e
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -25,7 +25,7 @@
#define MINIMIZE_PLATFORM_DEPENDENCY
#ifdef MINIMIZE_PLATFORM_DEPENDENCY
#if defined(MINIMIZE_PLATFORM_DEPENDENCY)
# define QSE_MEMCPY(dst,src,len) qse_memcpy(dst,src,len)
# define QSE_MEMMOVE(dst,src,len) qse_memmove(dst,src,len)
# define QSE_MEMCMP(p1,p2,len) qse_memcmp(p1,p2,len)

View File

@ -961,7 +961,7 @@ create_process:
QSE_NULL, /* LPSECURITY_ATTRIBUTES lpProcessAttributes */
QSE_NULL, /* LPSECURITY_ATTRIBUTES lpThreadAttributes */
TRUE, /* BOOL bInheritHandles */
#ifdef QSE_CHAR_IS_MCHAR
#if defined(QSE_CHAR_IS_MCHAR)
0, /* DWORD dwCreationFlags */
#else
CREATE_UNICODE_ENVIRONMENT, /* DWORD dwCreationFlags */
@ -1216,7 +1216,7 @@ create_process:
{
qse_size_t n, mn;
#ifdef QSE_CHAR_IS_MCHAR
#if defined(QSE_CHAR_IS_MCHAR)
mn = qse_strlen(cmd);
#else
if (flags & QSE_PIO_MBSCMD)
@ -1242,7 +1242,7 @@ create_process:
qse_mbscpy (cmd_line, QSE_MT("cmd.exe")); /* cmd.exe\0/c */
qse_mbscpy (&cmd_line[8], QSE_MT("/c "));
#ifdef QSE_CHAR_IS_MCHAR
#if defined(QSE_CHAR_IS_MCHAR)
qse_mbscpy (&cmd_line[11], cmd);
#else
if (flags & QSE_PIO_MBSCMD)
@ -1264,7 +1264,7 @@ create_process:
qse_mchar_t* mptr;
qse_size_t mn;
#ifdef QSE_CHAR_IS_MCHAR
#if defined(QSE_CHAR_IS_MCHAR)
mn = qse_strlen(cmd);
cmd_line = qse_strdup2 (cmd, QSE_T(" "), pio->mmgr);
if (cmd_line == QSE_NULL)

View File

@ -430,7 +430,7 @@ static int getc (comp_t* com, int noesc)
}
}
}
#ifdef QSE_CHAR_IS_WCHAR
#if defined(QSE_CHAR_IS_WCHAR)
else if (c == QSE_T('u') && QSE_SIZEOF(qse_char_t) >= 2)
{
qse_char_t cx;

View File

@ -34,10 +34,10 @@
# endif
#endif
#ifdef HAVE_WCHAR_H
#if defined(HAVE_WCHAR_H)
# include <wchar.h>
#endif
#ifdef HAVE_STDLIB_H
#if defined(HAVE_STDLIB_H)
# include <stdlib.h>
#endif
#if defined(_WIN32)

View File

@ -406,7 +406,7 @@ int qse_timegm (const qse_btime_t* bt, qse_ntime_t* nt)
tm.tm_yday = bt->yday;
tm.tm_isdst = bt->isdst;
#ifdef HAVE_TIMEGM
#if defined(HAVE_TIMEGM)
*nt = ((qse_ntime_t)timegm(&tm)*QSE_MSECS_PER_SEC) + bt->msec;
return 0;
#else

View File

@ -236,7 +236,7 @@ int qse_tre_execx (
tre->errnum = QSE_TRE_EBADPAT;
return -1;
}
#ifdef QSE_CHAR_IS_WCHAR
#if defined(QSE_CHAR_IS_WCHAR)
ret = tre_match (tre, str, len, STR_WIDE, nmatch, pmatch, eflags);
#else
ret = tre_match (tre, str, len, STR_BYTE, nmatch, pmatch, eflags);

View File

@ -169,7 +169,7 @@ int qse_xma_init (qse_xma_t* xma, qse_mmgr_t* mmgr, qse_size_t zonesize)
xma->head = free;
/* initialize some statistical variables */
#ifdef QSE_XMA_ENABLE_STAT
#if defined(QSE_XMA_ENABLE_STAT)
xma->stat.total = zonesize;
xma->stat.alloc = 0;
xma->stat.avail = zonesize - HDRSIZE;
@ -287,11 +287,11 @@ static qse_xma_blk_t* alloc_from_freelist (
/* add the remaining part to the free list */
attach_to_freelist (xma, tmp);
#ifdef QSE_XMA_ENABLE_STAT
#if defined(QSE_XMA_ENABLE_STAT)
xma->stat.avail -= HDRSIZE;
#endif
}
#ifdef QSE_XMA_ENABLE_STAT
#if defined(QSE_XMA_ENABLE_STAT)
else
{
/* decrement the number of free blocks as the current
@ -306,7 +306,7 @@ static qse_xma_blk_t* alloc_from_freelist (
free->f.prev = QSE_NULL;
*/
#ifdef QSE_XMA_ENABLE_STAT
#if defined(QSE_XMA_ENABLE_STAT)
xma->stat.nused++;
xma->stat.alloc += free->size;
xma->stat.avail -= free->size;
@ -344,7 +344,7 @@ void* qse_xma_alloc (qse_xma_t* xma, qse_size_t size)
detach_from_freelist (xma, free);
free->avail = 0;
#ifdef QSE_XMA_ENABLE_STAT
#if defined(QSE_XMA_ENABLE_STAT)
xma->stat.nfree--;
xma->stat.nused++;
xma->stat.alloc += free->size;
@ -445,7 +445,7 @@ static void* _realloc_merge (qse_xma_t* xma, void* b, qse_size_t size)
blk->b.next = tmp;
tmp->b.prev = blk;
#ifdef QSE_XMA_ENABLE_STAT
#if defined(QSE_XMA_ENABLE_STAT)
xma->stat.alloc += req;
xma->stat.avail -= req; /* req + HDRSIZE(tmp) - HDRSIZE(n) */
#endif
@ -458,7 +458,7 @@ static void* _realloc_merge (qse_xma_t* xma, void* b, qse_size_t size)
blk->b.next = n->b.next;
if (n->b.next) n->b.next->b.prev = blk;
#ifdef QSE_XMA_ENABLE_STAT
#if defined(QSE_XMA_ENABLE_STAT)
xma->stat.nfree--;
xma->stat.alloc += HDRSIZE + n->size;
xma->stat.avail -= n->size;
@ -496,7 +496,7 @@ static void* _realloc_merge (qse_xma_t* xma, void* b, qse_size_t size)
tmp->size = rem - HDRSIZE + HDRSIZE + n->size;
#ifdef QSE_XMA_ENABLE_STAT
#if defined(QSE_XMA_ENABLE_STAT)
xma->stat.alloc -= rem;
/* rem - HDRSIZE(tmp) + HDRSIZE(n) */
xma->stat.avail += rem;
@ -513,7 +513,7 @@ static void* _realloc_merge (qse_xma_t* xma, void* b, qse_size_t size)
tmp->size = rem - HDRSIZE;
#ifdef QSE_XMA_ENABLE_STAT
#if defined(QSE_XMA_ENABLE_STAT)
xma->stat.nfree++;
xma->stat.alloc -= rem;
xma->stat.avail += tmp->size;
@ -570,7 +570,7 @@ void qse_xma_free (qse_xma_t* xma, void* b)
/*QSE_ASSERT (blk->f.next == QSE_NULL);*/
#ifdef QSE_XMA_ENABLE_STAT
#if defined(QSE_XMA_ENABLE_STAT)
/* update statistical variables */
xma->stat.nused--;
xma->stat.alloc -= blk->size;
@ -615,7 +615,7 @@ void qse_xma_free (qse_xma_t* xma, void* b)
attach_to_freelist (xma, x);
#ifdef QSE_XMA_ENABLE_STAT
#if defined(QSE_XMA_ENABLE_STAT)
xma->stat.nfree--;
xma->stat.avail += ns;
#endif
@ -646,7 +646,7 @@ void qse_xma_free (qse_xma_t* xma, void* b)
qse_xma_blk_t* x = blk->b.next;
qse_xma_blk_t* y = x->b.next;
#ifdef QSE_XMA_ENABLE_STAT
#if defined(QSE_XMA_ENABLE_STAT)
xma->stat.avail += blk->size + HDRSIZE;
#endif
@ -694,7 +694,7 @@ void qse_xma_free (qse_xma_t* xma, void* b)
qse_xma_blk_t* x = blk->b.prev;
qse_xma_blk_t* y = blk->b.next;
#ifdef QSE_XMA_ENABLE_STAT
#if defined(QSE_XMA_ENABLE_STAT)
xma->stat.avail += HDRSIZE + blk->size;
#endif
@ -711,7 +711,7 @@ void qse_xma_free (qse_xma_t* xma, void* b)
blk->avail = 1;
attach_to_freelist (xma, blk);
#ifdef QSE_XMA_ENABLE_STAT
#if defined(QSE_XMA_ENABLE_STAT)
xma->stat.nfree++;
xma->stat.avail += blk->size;
#endif
@ -722,13 +722,13 @@ void qse_xma_dump (qse_xma_t* xma, qse_xma_dumper_t dumper, void* ctx)
{
qse_xma_blk_t* tmp;
qse_ulong_t fsum, asum;
#ifdef QSE_XMA_ENABLE_STAT
#if defined(QSE_XMA_ENABLE_STAT)
qse_ulong_t isum;
#endif
dumper (ctx, QSE_T("<XMA DUMP>\n"));
#ifdef QSE_XMA_ENABLE_STAT
#if defined(QSE_XMA_ENABLE_STAT)
dumper (ctx, QSE_T("== statistics ==\n"));
#if (QSE_SIZEOF_SIZE_T == QSE_SIZEOF_LONG)
dumper (ctx, QSE_T("total = %lu\n"), (unsigned long)xma->stat.total);
@ -770,7 +770,7 @@ void qse_xma_dump (qse_xma_t* xma, qse_xma_dumper_t dumper, void* ctx)
else asum += tmp->size;
}
#ifdef QSE_XMA_ENABLE_STAT
#if defined(QSE_XMA_ENABLE_STAT)
isum = (xma->stat.nfree + xma->stat.nused) * HDRSIZE;
#endif
@ -788,7 +788,7 @@ void qse_xma_dump (qse_xma_t* xma, qse_xma_dumper_t dumper, void* ctx)
# error weird size of qse_ulong_t. unsupported platform
#endif
#ifdef QSE_XMA_ENABLE_STAT
#if defined(QSE_XMA_ENABLE_STAT)
#if (QSE_SIZEOF_ULONG_T == QSE_SIZEOF_LONG)
dumper (ctx, QSE_T("Internal use : %18lu bytes\n"), (unsigned long)isum);
dumper (ctx, QSE_T("Total : %18lu bytes\n"), (unsigned long)(asum + fsum + isum));
@ -803,7 +803,7 @@ void qse_xma_dump (qse_xma_t* xma, qse_xma_dumper_t dumper, void* ctx)
#endif
#endif
#ifdef QSE_XMA_ENABLE_STAT
#if defined(QSE_XMA_ENABLE_STAT)
QSE_ASSERT (asum == xma->stat.alloc);
QSE_ASSERT (fsum == xma->stat.avail);
QSE_ASSERT (isum == xma->stat.total - (xma->stat.alloc + xma->stat.avail));

View File

@ -87,14 +87,14 @@ struct qse_upxd_t
qse_uint8_t rbuf[65535];
};
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
int qse_upxd_init (qse_upxd_t* upxd, qse_mmgr_t* mmgr);
void qse_upxd_fini (qse_upxd_t* upxd);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif

View File

@ -691,7 +691,7 @@ Omitted for clash with regular expression \b.
break;
}
#ifdef QSE_CHAR_IS_WCHAR
#if defined(QSE_CHAR_IS_WCHAR)
case QSE_T('X'):
{
/* \Xnnnn or \Xnnnnnnnn for wchar_t */
@ -2479,7 +2479,7 @@ static int write_str_clearly (
if (QSE_ISPRINT(c)) WRITE_CHAR (sed, c);
else
{
#ifdef QSE_CHAR_IS_MCHAR
#if defined(QSE_CHAR_IS_MCHAR)
WRITE_CHAR (sed, QSE_T('\\'));
WRITE_NUM (sed, (unsigned char)c, 8, QSE_SIZEOF(qse_char_t)*3);
#else
@ -2579,7 +2579,7 @@ static int write_file (
{
qse_ssize_t n;
qse_sed_io_arg_t arg;
#ifdef QSE_CHAR_IS_MCHAR
#if defined(QSE_CHAR_IS_MCHAR)
qse_char_t buf[1024];
#else
qse_char_t buf[512];

View File

@ -216,7 +216,7 @@ struct qse_sed_t
} e;
};
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#endif
@ -234,7 +234,7 @@ const qse_char_t* qse_sed_dflerrstr (
qse_sed_errnum_t errnum
);
#ifdef __cplusplus
#if defined(__cplusplus)
}
#endif